Fix removing pinned message notification.
GitOrigin-RevId: d01a6d955944f5990c59fc5a1e565f7d9956bcb3
This commit is contained in:
parent
03945ea7b9
commit
bf95e2f051
@ -10302,10 +10302,9 @@ void MessagesManager::set_dialog_pinned_message_notification(Dialog *d, MessageI
|
|||||||
if (old_message_id.is_valid()) {
|
if (old_message_id.is_valid()) {
|
||||||
auto m = get_message_force(d, old_message_id, "set_dialog_pinned_message_notification");
|
auto m = get_message_force(d, old_message_id, "set_dialog_pinned_message_notification");
|
||||||
if (m != nullptr && m->notification_id.is_valid() && is_message_notification_active(d, m)) {
|
if (m != nullptr && m->notification_id.is_valid() && is_message_notification_active(d, m)) {
|
||||||
// to not call set_dialog_pinned_message_notification recursively from remove_message_notification_id
|
// Because we removing pinned message notification it will call set_dialog_pinned_message_notification recursively
|
||||||
// can't be set before is_message_notification_active check
|
// after m->notification_id is removed, so everything will work. Can't remove pinned_message_notification_message_id
|
||||||
d->pinned_message_notification_message_id = message_id;
|
// before the call, because the notification needs to be still active inside remove_message_notification_id
|
||||||
|
|
||||||
remove_message_notification_id(d, m, true, false);
|
remove_message_notification_id(d, m, true, false);
|
||||||
on_message_changed(d, m, false, "set_dialog_pinned_message_notification");
|
on_message_changed(d, m, false, "set_dialog_pinned_message_notification");
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user