summaryrefslogtreecommitdiff
path: root/protocols/Telegram/tdlib/td/td/telegram/DialogNotificationSettings.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Telegram/tdlib/td/td/telegram/DialogNotificationSettings.hpp')
-rw-r--r--protocols/Telegram/tdlib/td/td/telegram/DialogNotificationSettings.hpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/protocols/Telegram/tdlib/td/td/telegram/DialogNotificationSettings.hpp b/protocols/Telegram/tdlib/td/td/telegram/DialogNotificationSettings.hpp
index bd48b1457c..3b3f0e2f2b 100644
--- a/protocols/Telegram/tdlib/td/td/telegram/DialogNotificationSettings.hpp
+++ b/protocols/Telegram/tdlib/td/td/telegram/DialogNotificationSettings.hpp
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -20,6 +20,9 @@ void store(const DialogNotificationSettings &notification_settings, StorerT &sto
notification_settings.mute_until > G()->unix_time();
bool has_sound = notification_settings.sound != nullptr;
bool has_ringtone_support = true;
+ bool use_mute_stories = !notification_settings.use_default_mute_stories;
+ bool has_story_sound = notification_settings.story_sound != nullptr;
+ bool use_hide_story_sender = !notification_settings.use_default_hide_story_sender;
BEGIN_STORE_FLAGS();
STORE_FLAG(is_muted);
STORE_FLAG(has_sound);
@@ -36,6 +39,11 @@ void store(const DialogNotificationSettings &notification_settings, StorerT &sto
STORE_FLAG(notification_settings.disable_mention_notifications);
STORE_FLAG(notification_settings.is_secret_chat_show_preview_fixed);
STORE_FLAG(has_ringtone_support);
+ STORE_FLAG(notification_settings.mute_stories);
+ STORE_FLAG(use_mute_stories);
+ STORE_FLAG(has_story_sound);
+ STORE_FLAG(notification_settings.hide_story_sender);
+ STORE_FLAG(use_hide_story_sender);
END_STORE_FLAGS();
if (is_muted) {
store(notification_settings.mute_until, storer);
@@ -43,6 +51,9 @@ void store(const DialogNotificationSettings &notification_settings, StorerT &sto
if (has_sound) {
store(notification_settings.sound, storer);
}
+ if (has_story_sound) {
+ store(notification_settings.story_sound, storer);
+ }
}
template <class ParserT>
@@ -53,6 +64,9 @@ void parse(DialogNotificationSettings &notification_settings, ParserT &parser) {
bool use_disable_pinned_message_notifications;
bool use_disable_mention_notifications;
bool has_ringtone_support;
+ bool use_mute_stories;
+ bool has_story_sound;
+ bool use_hide_story_sender;
BEGIN_PARSE_FLAGS();
PARSE_FLAG(is_muted);
PARSE_FLAG(has_sound);
@@ -69,9 +83,16 @@ void parse(DialogNotificationSettings &notification_settings, ParserT &parser) {
PARSE_FLAG(notification_settings.disable_mention_notifications);
PARSE_FLAG(notification_settings.is_secret_chat_show_preview_fixed);
PARSE_FLAG(has_ringtone_support);
+ PARSE_FLAG(notification_settings.mute_stories);
+ PARSE_FLAG(use_mute_stories);
+ PARSE_FLAG(has_story_sound);
+ PARSE_FLAG(notification_settings.hide_story_sender);
+ PARSE_FLAG(use_hide_story_sender);
END_PARSE_FLAGS();
notification_settings.use_default_disable_pinned_message_notifications = !use_disable_pinned_message_notifications;
notification_settings.use_default_disable_mention_notifications = !use_disable_mention_notifications;
+ notification_settings.use_default_mute_stories = !use_mute_stories;
+ notification_settings.use_default_hide_story_sender = !use_hide_story_sender;
if (is_muted) {
parse(notification_settings.mute_until, parser);
}
@@ -84,6 +105,9 @@ void parse(DialogNotificationSettings &notification_settings, ParserT &parser) {
notification_settings.sound = use_default_sound ? nullptr : get_legacy_notification_sound(sound);
}
}
+ if (has_story_sound) {
+ parse_notification_sound(notification_settings.story_sound, parser);
+ }
}
} // namespace td