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

Load folder dialogs list.

This commit is contained in:
John Preston
2019-04-17 16:08:02 +04:00
parent be0cf8d379
commit 0367319934
10 changed files with 144 additions and 118 deletions

View File

@@ -2431,7 +2431,7 @@ bool History::isServerSideUnread(not_null<const HistoryItem*> item) const {
: (!_inboxReadBefore || (item->id >= *_inboxReadBefore));
}
void History::applyDialog(const MTPDdialog &data) {
void History::applyDialog(FolderId requestFolderId, const MTPDdialog &data) {
applyDialogFields(
data.vunread_count.v,
data.vread_inbox_max_id.v,
@@ -2461,6 +2461,15 @@ void History::applyDialog(const MTPDdialog &data) {
if (data.has_draft() && data.vdraft.type() == mtpc_draftMessage) {
Data::applyPeerCloudDraft(peer->id, data.vdraft.c_draftMessage());
}
const auto folderId = data.has_folder_id()
? data.vfolder_id.v
: requestFolderId;
if (folderId) {
setFolder(owner().folder(folderId));
} else {
clearFolder();
}
session().api().dialogEntryApplied(this);
}