2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-02 15:35:51 +00:00

forward/delete for channels, prepared load unread by offset_id, not done yet!

This commit is contained in:
John Preston
2015-09-07 10:52:37 +03:00
parent b53e35e046
commit 54d5b6dd71
14 changed files with 205 additions and 107 deletions

View File

@@ -1580,16 +1580,20 @@ namespace App {
return ::histories;
}
History *history(const PeerId &peer, int32 unreadCnt, int32 maxInboxRead) {
History *history(const PeerId &peer) {
Histories::const_iterator i = ::histories.constFind(peer);
if (i == ::histories.cend()) {
i = App::histories().insert(peer, new History(peer));
}
return i.value();
}
History *historyFromDialog(const PeerId &peer, int32 unreadCnt, int32 maxInboxRead) {
Histories::const_iterator i = ::histories.constFind(peer);
if (i == ::histories.cend()) {
i = App::histories().insert(peer, new History(peer));
i.value()->setUnreadCount(unreadCnt, false);
if (maxInboxRead) {
i.value()->inboxReadTill = maxInboxRead;
}
} else if (maxInboxRead) {
i.value()->inboxReadTill = qMax(i.value()->inboxReadTill, maxInboxRead);
i.value()->inboxReadBefore = maxInboxRead + 1;
}
return i.value();
}