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

Notify about published scheduled messages.

This commit is contained in:
John Preston
2019-08-28 17:24:12 +03:00
parent 3b76a908a4
commit 0a4f91a53d
21 changed files with 423 additions and 179 deletions

View File

@@ -1242,19 +1242,28 @@ void History::newItemAdded(not_null<HistoryItem*> item) {
from->madeAction(item->date());
}
item->contributeToSlowmode();
if (item->out()) {
if (item->showNotification()) {
_notifications.push_back(item);
owner().notifyUnreadItemAdded(item);
const auto stillShow = item->showNotification();
if (stillShow) {
session().notifications().schedule(item);
if (!item->out() && item->unread()) {
if (unreadCountKnown()) {
setUnreadCount(unreadCount() + 1);
} else {
session().api().requestDialogEntry(this);
}
}
}
} else if (item->out()) {
destroyUnreadBar();
if (!item->unread()) {
outboxRead(item);
}
} else if (item->unread()) {
if (!isChannel() || peer->asChannel()->amIn()) {
_notifications.push_back(item);
App::main()->newUnreadMsg(this, item);
}
} else {
inboxRead(item);
}
if (item->out() && !item->unread()) {
outboxRead(item);
}
if (!folderKnown()) {
session().api().requestDialogEntry(this);
}