From a9010187965aad066bd04133876e260fec6d7e2b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 4 Nov 2024 17:18:39 +0300 Subject: code cleaning --- protocols/Telegram/src/options.cpp | 4 +--- protocols/Telegram/src/proto.cpp | 5 +++++ protocols/Telegram/src/resource.h | 3 --- protocols/Telegram/src/utils.cpp | 2 -- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/protocols/Telegram/src/options.cpp b/protocols/Telegram/src/options.cpp index 8b31ce3c1c..be588e33ea 100644 --- a/protocols/Telegram/src/options.cpp +++ b/protocols/Telegram/src/options.cpp @@ -22,7 +22,7 @@ along with this program. If not, see . class COptionsDlg : public CTelegramDlgBase { CCtrlButton btnLogout; - CCtrlCheck chkHideChats, chkUsePopups, chkCompressFiles, chkIncludePreviews, chkResidentChannels; + CCtrlCheck chkHideChats, chkCompressFiles, chkIncludePreviews, chkResidentChannels; CCtrlCombo cmbCountry; CCtrlEdit edtGroup, edtPhone, edtDeviceName; ptrW m_wszOldGroup; @@ -32,7 +32,6 @@ public: CTelegramDlgBase(ppro, iDlgID), btnLogout(this, IDC_LOGOUT), cmbCountry(this, IDC_COUNTRY), - chkUsePopups(this, IDC_POPUPS), chkHideChats(this, IDC_HIDECHATS), edtPhone(this, IDC_PHONE), edtGroup(this, IDC_DEFGROUP), @@ -48,7 +47,6 @@ public: CreateLink(chkHideChats, ppro->m_bHideGroupchats); if (bFullDlg) { - CreateLink(chkUsePopups, ppro->m_bUsePopups); CreateLink(chkCompressFiles, ppro->m_bCompressFiles); CreateLink(chkIncludePreviews, ppro->m_bIncludePreviews); CreateLink(chkResidentChannels, ppro->m_bResidentChannels); diff --git a/protocols/Telegram/src/proto.cpp b/protocols/Telegram/src/proto.cpp index ab8a4f10b2..73834415b8 100644 --- a/protocols/Telegram/src/proto.cpp +++ b/protocols/Telegram/src/proto.cpp @@ -83,6 +83,9 @@ CTelegramProto::CTelegramProto(const char* protoName, const wchar_t* userName) : // menus InitMenus(); + // popups + g_plugin.addPopupOption(CMStringW(FORMAT, TranslateT("%s error notifications"), m_tszUserName), m_bUsePopups); + // Cloud file transfer CreateProtoService(PS_OFFLINEFILE, &CTelegramProto::SvcOfflineFile); @@ -169,6 +172,8 @@ bool CTelegramProto::OnContactDeleted(MCONTACT hContact, uint32_t flags) void CTelegramProto::OnModulesLoaded() { + InitPopups(); + m_bSmileyAdd = ServiceExists(MS_SMILEYADD_REPLACESMILEYS); if (m_bSmileyAdd) SmileyAdd_LoadContactSmileys(SMADD_FOLDER, m_szModuleName, GetAvatarPath() + L"\\Stickers\\*.*"); diff --git a/protocols/Telegram/src/resource.h b/protocols/Telegram/src/resource.h index 59a64c9a48..9e6bebafce 100644 --- a/protocols/Telegram/src/resource.h +++ b/protocols/Telegram/src/resource.h @@ -17,9 +17,6 @@ #define IDC_PHONE 1001 #define IDC_DEFGROUP 1002 #define IDC_HIDECHATS 1003 -#define IDC_POPUPS 1004 -#define IDC_DEFGROUP2 1004 -#define IDC_HIDECHATS2 1004 #define IDC_DEVICE_NAME 1005 #define IDC_DIFF1 1006 #define IDC_DIFF2 1007 diff --git a/protocols/Telegram/src/utils.cpp b/protocols/Telegram/src/utils.cpp index 768c7972f3..4d06f7b807 100644 --- a/protocols/Telegram/src/utils.cpp +++ b/protocols/Telegram/src/utils.cpp @@ -382,8 +382,6 @@ TG_USER* CTelegramProto::AddUser(int64_t id, bool bIsChat) void CTelegramProto::InitPopups(void) { - g_plugin.addPopupOption(CMStringW(FORMAT, TranslateT("%s error notifications"), m_tszUserName), m_bUsePopups); - char name[256]; mir_snprintf(name, "%s_%s", m_szModuleName, "Error"); -- cgit v1.2.3