summaryrefslogtreecommitdiff
path: root/protocols/Telegram/src/groupchat.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-03-22 17:46:49 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-03-22 17:46:49 +0300
commited54464972bcea62c617e1ade88722454b037ee0 (patch)
treedd20ac95a60aecd523676eef852f5fcda3f80b3b /protocols/Telegram/src/groupchat.cpp
parenta7ef6936c39f27ae844712c549ad5d5bc5a19015 (diff)
fixes #3448 (Telegram: настройка глушения чатов синхронизируется лишь в одну сторону (от сервера к нам)
Diffstat (limited to 'protocols/Telegram/src/groupchat.cpp')
-rw-r--r--protocols/Telegram/src/groupchat.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/protocols/Telegram/src/groupchat.cpp b/protocols/Telegram/src/groupchat.cpp
index b32db4c13f..c0ea6165e8 100644
--- a/protocols/Telegram/src/groupchat.cpp
+++ b/protocols/Telegram/src/groupchat.cpp
@@ -130,6 +130,32 @@ void CTelegramProto::StartGroupChat(td::ClientManager::Response &response, void
/////////////////////////////////////////////////////////////////////////////////////////
+int CTelegramProto::GcMuteHook(WPARAM hContact, LPARAM mode)
+{
+ if (Proto_IsProtoOnContact(hContact, m_szModuleName)) {
+ if (auto *pUser = FindUser(_atoi64(getMStringA(hContact, DBKEY_ID)))) {
+ auto settings = TD::make_object<TD::chatNotificationSettings>();
+ memcpy(settings.get(), &pUser->notificationSettings, sizeof(pUser->notificationSettings));
+
+ switch (mode) {
+ case CHATMODE_MUTE:
+ settings->use_default_mute_for_ = false;
+ settings->mute_for_ = 45000000;
+ break;
+
+ default:
+ settings->use_default_mute_for_ = true;
+ settings->mute_for_ = 0;
+ break;
+ }
+ SendQuery(new TD::setChatNotificationSettings(pUser->chatId, std::move(settings)));
+ }
+ }
+ return 0;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
enum
{
IDM_LEAVE = 1,