diff options
Diffstat (limited to 'protocols/Telegram/src')
-rw-r--r-- | protocols/Telegram/src/proto.cpp | 2 | ||||
-rw-r--r-- | protocols/Telegram/src/utils.cpp | 9 |
2 files changed, 4 insertions, 7 deletions
diff --git a/protocols/Telegram/src/proto.cpp b/protocols/Telegram/src/proto.cpp index ba9565f09f..fa9313c0be 100644 --- a/protocols/Telegram/src/proto.cpp +++ b/protocols/Telegram/src/proto.cpp @@ -83,7 +83,7 @@ void CTelegramProto::OnModulesLoaded() } bool isGroupChat = isChatRoom(cc); - szId = getMStringA(cc, isGroupChat ? "ChatRoomID" : DBKEY_ID); + szId = getMStringA(cc, DBKEY_ID); if (!szId.IsEmpty()) { auto *pUser = new TG_USER(_atoi64(szId.c_str()), cc, isGroupChat); pUser->szAvatarHash = getMStringA(cc, DBKEY_AVATAR_HASH); diff --git a/protocols/Telegram/src/utils.cpp b/protocols/Telegram/src/utils.cpp index 4a122f70c1..bcf222ecab 100644 --- a/protocols/Telegram/src/utils.cpp +++ b/protocols/Telegram/src/utils.cpp @@ -47,17 +47,14 @@ TG_USER* CTelegramProto::AddUser(uint64_t id, bool bIsChat) char szId[100];
_i64toa(id, szId, 10);
+ setString(hContact, DBKEY_ID, szId);
if (bIsChat) {
Clist_SetGroup(hContact, TranslateT("Chat rooms"));
setByte(hContact, "ChatRoom", 1);
- setString(hContact, "ChatRoomID", szId);
- }
- else {
- setString(hContact, DBKEY_ID, szId);
- if (mir_wstrlen(m_wszDefaultGroup))
- Clist_SetGroup(hContact, m_wszDefaultGroup);
}
+ else if (mir_wstrlen(m_wszDefaultGroup))
+ Clist_SetGroup(hContact, m_wszDefaultGroup);
pUser = new TG_USER(id, hContact, bIsChat);
m_arUsers.insert(pUser);
|