From 9885bf54f788e831a80c76001340aa68d31d2aaa Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 25 Jan 2023 18:34:51 +0300 Subject: Group chats: ChatRoomID setting replaced with real protocol id --- protocols/Telegram/src/proto.cpp | 2 +- protocols/Telegram/src/utils.cpp | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'protocols/Telegram/src') 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); -- cgit v1.2.3