Added notifier of archiving pinned dialog to update touchbar.

This commit is contained in:
23rd 2019-06-26 20:25:11 +03:00 committed by John Preston
parent 26569683ca
commit da6baeb1a7
1 changed files with 4 additions and 0 deletions

View File

@ -507,6 +507,7 @@ void ApiWrap::toggleHistoryArchived(
if (const auto already = _historyArchivedRequests.take(history)) {
request(already->first).cancel();
}
const auto isPinned = history->isPinnedDialog();
const auto archiveId = Data::Folder::kId;
const auto requestId = request(MTPfolders_EditPeerFolders(
MTP_vector<MTPInputFolderPeer>(
@ -524,6 +525,9 @@ void ApiWrap::toggleHistoryArchived(
if (const auto data = _historyArchivedRequests.take(history)) {
data->second();
}
if (isPinned) {
_session->data().notifyPinnedDialogsOrderUpdated();
}
}).fail([=](const RPCError &error) {
_historyArchivedRequests.remove(history);
}).send();