@@ -26937,9 +26937,8 @@ Result<MessagesManager::MessagePushNotificationInfo> MessagesManager::get_messag
26937
26937
if (message_id.is_valid()) {
26938
26938
auto notification_info = add_dialog_notification_info(d);
26939
26939
if (message_id > notification_info->max_push_notification_message_id_) {
26940
- if (is_new_pinned) {
26941
- set_dialog_pinned_message_notification(d, contains_mention ? message_id : MessageId(),
26942
- "get_message_push_notification_info");
26940
+ if (is_new_pinned && contains_mention) {
26941
+ set_dialog_pinned_message_notification(d, message_id, "get_message_push_notification_info");
26943
26942
}
26944
26943
notification_info->max_push_notification_message_id_ = message_id;
26945
26944
on_dialog_updated(dialog_id, "set_max_push_notification_message_id");
@@ -27814,7 +27813,7 @@ bool MessagesManager::add_new_message_notification(Dialog *d, Message *m, bool f
27814
27813
}
27815
27814
if (!is_active) {
27816
27815
VLOG(notifications) << "Disable inactive notification for " << m->message_id << " in " << d->dialog_id;
27817
- if (is_pinned) {
27816
+ if (is_pinned && from_mentions ) {
27818
27817
remove_dialog_pinned_message_notification(d, "add_new_message_notification");
27819
27818
}
27820
27819
return false;
@@ -27840,7 +27839,7 @@ bool MessagesManager::add_new_message_notification(Dialog *d, Message *m, bool f
27840
27839
std::tie(have_settings, mute_until) = get_dialog_mute_until(settings_dialog_id, settings_dialog);
27841
27840
if (mute_until > m->date && (have_settings || force)) {
27842
27841
VLOG(notifications) << "Disable notification, because " << settings_dialog_id << " is muted";
27843
- if (is_pinned) {
27842
+ if (is_pinned && from_mentions ) {
27844
27843
remove_dialog_pinned_message_notification(d, "add_new_message_notification");
27845
27844
}
27846
27845
return false;
@@ -27914,9 +27913,8 @@ bool MessagesManager::add_new_message_notification(Dialog *d, Message *m, bool f
27914
27913
}
27915
27914
set_dialog_last_notification_checked(d->dialog_id, group_info, m->date, m->notification_id,
27916
27915
"add_new_message_notification 3");
27917
- if (is_pinned) {
27918
- set_dialog_pinned_message_notification(d, from_mentions ? m->message_id : MessageId(),
27919
- "add_new_message_notification");
27916
+ if (is_pinned && from_mentions) {
27917
+ set_dialog_pinned_message_notification(d, m->message_id, "add_new_message_notification");
27920
27918
}
27921
27919
if (!m->notification_id.is_valid()) {
27922
27920
// protection from accidental notification_id removal in set_dialog_pinned_message_notification
0 commit comments