Fix notifications settings of newly created chats.
This commit is contained in:
parent
cb5fe8c7cd
commit
b3a0c1dcda
@ -20400,8 +20400,7 @@ DialogId MessagesManager::create_new_group_chat(const vector<UserId> &user_ids,
|
||||
created_dialogs_.erase(it);
|
||||
|
||||
// set default notification settings to newly created chat
|
||||
on_update_dialog_notify_settings(dialog_id, make_tl_object<telegram_api::peerNotifySettings>(),
|
||||
"create_new_group_chat");
|
||||
on_update_dialog_notify_settings(dialog_id, nullptr, "create_new_group_chat");
|
||||
|
||||
promise.set_value(Unit());
|
||||
return dialog_id;
|
||||
@ -20454,8 +20453,7 @@ DialogId MessagesManager::create_new_channel_chat(const string &title, bool is_m
|
||||
created_dialogs_.erase(it);
|
||||
|
||||
// set default notification settings to newly created chat
|
||||
on_update_dialog_notify_settings(dialog_id, make_tl_object<telegram_api::peerNotifySettings>(),
|
||||
"create_new_channel_chat");
|
||||
on_update_dialog_notify_settings(dialog_id, nullptr, "create_new_channel_chat");
|
||||
|
||||
promise.set_value(Unit());
|
||||
return dialog_id;
|
||||
|
@ -176,6 +176,9 @@ DialogNotificationSettings get_dialog_notification_settings(tl_object_ptr<telegr
|
||||
bool old_disable_pinned_message_notifications,
|
||||
bool old_use_default_disable_mention_notifications,
|
||||
bool old_disable_mention_notifications) {
|
||||
if (settings == nullptr) {
|
||||
return DialogNotificationSettings();
|
||||
}
|
||||
bool use_default_mute_until = (settings->flags_ & telegram_api::peerNotifySettings::MUTE_UNTIL_MASK) == 0;
|
||||
bool use_default_sound = settings->other_sound_ == nullptr;
|
||||
bool use_default_show_preview = (settings->flags_ & telegram_api::peerNotifySettings::SHOW_PREVIEWS_MASK) == 0;
|
||||
@ -199,6 +202,9 @@ DialogNotificationSettings get_dialog_notification_settings(tl_object_ptr<telegr
|
||||
ScopeNotificationSettings get_scope_notification_settings(tl_object_ptr<telegram_api::peerNotifySettings> &&settings,
|
||||
bool old_disable_pinned_message_notifications,
|
||||
bool old_disable_mention_notifications) {
|
||||
if (settings == nullptr) {
|
||||
return ScopeNotificationSettings();
|
||||
}
|
||||
auto mute_until = (settings->flags_ & telegram_api::peerNotifySettings::MUTE_UNTIL_MASK) == 0 ||
|
||||
settings->mute_until_ <= G()->unix_time()
|
||||
? 0
|
||||
|
Loading…
Reference in New Issue
Block a user