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 /src | |
parent | 87ffacfcb26cb3e6378d3d4189cc565d5f487103 (diff) |
Telegram: patch to hide nick list for channels
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_app/src/chat_svc.cpp | 10 | ||||
-rw-r--r-- | src/mir_app/src/srmm_base.cpp | 7 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/mir_app/src/chat_svc.cpp b/src/mir_app/src/chat_svc.cpp index 47ad6d4954..8c72074600 100644 --- a/src/mir_app/src/chat_svc.cpp +++ b/src/mir_app/src/chat_svc.cpp @@ -241,10 +241,18 @@ MIR_APP_DLL(SESSION_INFO*) Chat_NewSession( si->pItemData = pItemData;
if (iType != GCW_SERVER)
si->wStatus = ID_STATUS_ONLINE;
- si->iType = iType;
si->ptszName = mir_wstrdup(ptszName);
si->currentHovered = -1;
+ if (iType == GCW_CHANNEL) {
+ si->iType = GCW_CHATROOM;
+ si->bHasNicklist = false;
+ }
+ else {
+ si->bHasNicklist = true;
+ si->iType = iType;
+ }
+
wchar_t szTemp[256];
if (si->iType == GCW_SERVER)
mir_snwprintf(szTemp, L"Server: %s", si->ptszName);
diff --git a/src/mir_app/src/srmm_base.cpp b/src/mir_app/src/srmm_base.cpp index 10bb17736a..eab87c6e78 100644 --- a/src/mir_app/src/srmm_base.cpp +++ b/src/mir_app/src/srmm_base.cpp @@ -501,8 +501,11 @@ bool CSrmmBaseDialog::OnInitDialog() ::DragAcceptFiles(m_message.GetHwnd(), TRUE);
if (isChat()) {
- SetWindowLongPtr(m_nickList.GetHwnd(), GWLP_USERDATA, LPARAM(this));
- mir_subclassWindow(m_nickList.GetHwnd(), stubNicklistProc);
+ if (m_si->bHasNicklist) {
+ SetWindowLongPtr(m_nickList.GetHwnd(), GWLP_USERDATA, LPARAM(this));
+ mir_subclassWindow(m_nickList.GetHwnd(), stubNicklistProc);
+ }
+ else m_bNicklistEnabled = false;
}
// three buttons below are initiated inside this call, so button creation must precede subclassing
|