summaryrefslogtreecommitdiff
path: root/protocols/Telegram/src/proto.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-05-20 21:51:34 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-05-20 21:51:34 +0300
commitf2daa4597c4b35578ccfba1127604cd5e07d6aa2 (patch)
tree195273b5afe43feca95382d2dca193544d1baeec /protocols/Telegram/src/proto.cpp
parent451303889fcd3e4a8ca4ec4928c3788641e8e755 (diff)
fixes #4422 (Telegram: добавление в чат средствами Миранды)
Diffstat (limited to 'protocols/Telegram/src/proto.cpp')
-rw-r--r--protocols/Telegram/src/proto.cpp8
1 files changed, 8 insertions, 0 deletions
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)