From 06b10526f17273cb93b68ade2a300bc7db9151ce Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 22 Jul 2022 11:35:09 +0300 Subject: [PATCH] Increase maximum allowed value for mute_for. --- td/generate/scheme/td_api.tl | 2 +- td/telegram/NotificationSettings.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index a624bb1ad..7bce47daf 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -5386,7 +5386,7 @@ setChatTheme chat_id:int53 theme_name:string = Ok; setChatDraftMessage chat_id:int53 message_thread_id:int53 draft_message:draftMessage = Ok; //@description Changes the notification settings of a chat. Notification settings of a chat with the current user (Saved Messages) can't be changed -//@chat_id Chat identifier @notification_settings New notification settings for the chat. If the chat is muted for more than 1 week, it is considered to be muted forever +//@chat_id Chat identifier @notification_settings New notification settings for the chat. If the chat is muted for more than 366 days, it is considered to be muted forever setChatNotificationSettings chat_id:int53 notification_settings:chatNotificationSettings = Ok; //@description Changes the ability of users to save, forward, or copy chat content. Supported only for basic groups, supergroups and channels. Requires owner privileges diff --git a/td/telegram/NotificationSettings.cpp b/td/telegram/NotificationSettings.cpp index 452ddaefd..7ee1962d2 100644 --- a/td/telegram/NotificationSettings.cpp +++ b/td/telegram/NotificationSettings.cpp @@ -119,7 +119,7 @@ static int32 get_mute_until(int32 mute_for) { return 0; } - const int32 MAX_PRECISE_MUTE_FOR = 7 * 86400; + const int32 MAX_PRECISE_MUTE_FOR = 366 * 86400; int32 current_time = G()->unix_time(); if (mute_for > MAX_PRECISE_MUTE_FOR || mute_for >= std::numeric_limits::max() - current_time) { return std::numeric_limits::max();