summaryrefslogtreecommitdiff
path: root/protocols/Telegram/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-01-25 18:34:51 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-01-25 18:34:51 +0300
commit9885bf54f788e831a80c76001340aa68d31d2aaa (patch)
tree420ab4aa5bf868d4193c965668ae68e5855093b7 /protocols/Telegram/src
parentc9d99d1525e2e9374ed0fa10837e82e76c3b9216 (diff)
Group chats: ChatRoomID setting replaced with real protocol id
Diffstat (limited to 'protocols/Telegram/src')
-rw-r--r--protocols/Telegram/src/proto.cpp2
-rw-r--r--protocols/Telegram/src/utils.cpp9
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);