summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--protocols/Telegram/src/groupchat.cpp3
-rw-r--r--protocols/Telegram/src/proto.cpp8
2 files changed, 11 insertions, 0 deletions
diff --git a/protocols/Telegram/src/groupchat.cpp b/protocols/Telegram/src/groupchat.cpp
index 80d217aff6..1d45d5630c 100644
--- a/protocols/Telegram/src/groupchat.cpp
+++ b/protocols/Telegram/src/groupchat.cpp
@@ -477,6 +477,9 @@ void CTelegramProto::ProcessSuperGroup(TD::updateSupergroup *pObj)
if (!pGroup->group->is_channel_)
pChat->bLoadMembers = true;
+ if (!Contact::OnList(pChat->hContact))
+ Contact::PutOnList(pChat->hContact);
+
if (pChat->bStartChat)
InitGroupChat(pChat, pChat->wszNick);
diff --git a/protocols/Telegram/src/proto.cpp b/protocols/Telegram/src/proto.cpp
index 94c26a3d62..5c3316484b 100644
--- a/protocols/Telegram/src/proto.cpp
+++ b/protocols/Telegram/src/proto.cpp
@@ -287,10 +287,18 @@ MCONTACT CTelegramProto::AddToList(int flags, PROTOSEARCHRESULT *psr)
return 0;
auto id = _wtoi64(psr->id.w);
+
auto *pUser = AddUser(id, false);
if (flags & PALF_TEMPORARY)
Contact::RemoveFromList(pUser->hContact);
+ if (auto *pChat = FindUser(id)) {
+ if (pChat->isGroupChat) {
+ SendQuery(new TD::joinChat(pChat->chatId));
+ return pUser->hContact;
+ }
+ }
+
auto cc = TD::make_object<TD::contact>();
cc->user_id_ = id;
if (psr->firstName.w)