summaryrefslogtreecommitdiff
path: root/protocols/Telegram/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Telegram/src')
-rw-r--r--protocols/Telegram/src/groupchat.cpp6
-rw-r--r--protocols/Telegram/src/server.cpp6
2 files changed, 10 insertions, 2 deletions
diff --git a/protocols/Telegram/src/groupchat.cpp b/protocols/Telegram/src/groupchat.cpp
index fdcb45faa7..0aa21fb752 100644
--- a/protocols/Telegram/src/groupchat.cpp
+++ b/protocols/Telegram/src/groupchat.cpp
@@ -24,9 +24,10 @@ void CTelegramProto::InitGroupChat(TG_USER *pUser, const TD::chat *pChat, bool b
wchar_t wszId[100];
_i64tow(pUser->id, wszId, 10);
- auto *si = pUser->m_si = Chat_NewSession(GCW_CHATROOM, m_szModuleName, wszId, Utf2T(pChat->title_.c_str()), pUser);
+ SESSION_INFO *si;
if (bUpdateMembers) {
+ si = Chat_NewSession(GCW_CHATROOM, m_szModuleName, wszId, Utf2T(pChat->title_.c_str()), pUser);
Chat_AddGroup(si, TranslateT("Creator"));
Chat_AddGroup(si, TranslateT("Admin"));
Chat_AddGroup(si, TranslateT("Participant"));
@@ -35,6 +36,7 @@ void CTelegramProto::InitGroupChat(TG_USER *pUser, const TD::chat *pChat, bool b
SendQuery(new TD::getBasicGroupFullInfo(pUser->id), &CTelegramProto::StartGroupChat, pUser);
}
else {
+ si = Chat_NewSession(GCW_CHANNEL, m_szModuleName, wszId, Utf2T(pChat->title_.c_str()), pUser);
Chat_AddGroup(si, TranslateT("SuperAdmin"));
Chat_AddGroup(si, TranslateT("Visitor"));
@@ -56,6 +58,8 @@ void CTelegramProto::InitGroupChat(TG_USER *pUser, const TD::chat *pChat, bool b
Chat_Control(si, m_bHideGroupchats ? WINDOW_HIDDEN : SESSION_INITDONE);
Chat_Control(si, SESSION_ONLINE);
}
+
+ pUser->m_si = si;
}
void CTelegramProto::StartGroupChat(td::ClientManager::Response &response, void *pUserData)
diff --git a/protocols/Telegram/src/server.cpp b/protocols/Telegram/src/server.cpp
index f4dfd60353..4517c8cca3 100644
--- a/protocols/Telegram/src/server.cpp
+++ b/protocols/Telegram/src/server.cpp
@@ -281,7 +281,11 @@ void CTelegramProto::ProcessChat(TD::updateNewChat *pObj)
break;
case TD::chatTypeSupergroup::ID:
- chatId = ((TD::chatTypeSupergroup*)pChat->type_.get())->supergroup_id_;
+ {
+ auto *pSuperGroup = (TD::chatTypeSupergroup *)pChat->type_.get();
+ chatId = pSuperGroup->supergroup_id_;
+ bIsBasicGroup = !pSuperGroup->is_channel_;
+ }
break;
default: