diff options
author | George Hazan <ghazan@miranda.im> | 2023-02-23 19:41:54 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2023-02-23 19:41:54 +0300 |
commit | bddc397fa9e6c164d0288b4665fa10806f8363fa (patch) | |
tree | 5b45c7981815f1ea346878106d4725f688b88014 /protocols | |
parent | 87ffacfcb26cb3e6378d3d4189cc565d5f487103 (diff) |
Telegram: patch to hide nick list for channels
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/Telegram/src/groupchat.cpp | 6 | ||||
-rw-r--r-- | protocols/Telegram/src/server.cpp | 6 |
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:
|