2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Fix scheduled notifications on inbox read.

This commit is contained in:
John Preston
2019-08-30 17:06:21 +03:00
parent d95e54cb1a
commit 3715fa4b1e
13 changed files with 60 additions and 46 deletions

View File

@@ -1658,10 +1658,7 @@ void History::inboxRead(MsgId upTo, std::optional<int> stillUnread) {
}
_firstUnreadView = nullptr;
if (!peer->isSelf()) {
// Only reminders generate notifications in Saved Messages.
session().notifications().clearFromHistory(this);
}
session().notifications().clearIncomingFromHistory(this);
}
void History::inboxRead(not_null<const HistoryItem*> wasRead) {
@@ -2175,6 +2172,14 @@ void History::clearNotifications() {
_notifications.clear();
}
void History::clearIncomingNotifications() {
if (!peer->isSelf()) {
_notifications.erase(
ranges::remove(_notifications, false, &HistoryItem::out),
end(_notifications));
}
}
bool History::loadedAtBottom() const {
return _loadedAtBottom;
}