summaryrefslogtreecommitdiff
path: root/protocols/Telegram/src/groupchat.cpp
diff options
context:
space:
mode:
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,