mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
Support pinned chats in folders.
This commit is contained in:
@@ -1835,6 +1835,9 @@ void History::setFolderPointer(Data::Folder *folder) {
|
||||
if (_folder == folder) {
|
||||
return;
|
||||
}
|
||||
if (isPinnedDialog()) {
|
||||
owner().setChatPinned(this, false);
|
||||
}
|
||||
const auto wasKnown = folderKnown();
|
||||
const auto wasInAll = inChatList(Mode::All);
|
||||
const auto wasInImportant = wasInAll && inChatList(Mode::Important);
|
||||
@@ -1864,6 +1867,18 @@ void History::setFolderPointer(Data::Folder *folder) {
|
||||
}
|
||||
}
|
||||
|
||||
void History::applyPinnedUpdate(const MTPDupdateDialogPinned &data) {
|
||||
const auto folderId = data.has_folder_id() ? data.vfolder_id.v : 0;
|
||||
if (!folderKnown()) {
|
||||
if (folderId) {
|
||||
setFolder(owner().folder(folderId));
|
||||
} else {
|
||||
clearFolder();
|
||||
}
|
||||
}
|
||||
owner().setChatPinned(this, data.is_pinned());
|
||||
}
|
||||
|
||||
TimeId History::adjustedChatListTimeId() const {
|
||||
const auto result = chatListTimeId();
|
||||
if (const auto draft = cloudDraft()) {
|
||||
|
Reference in New Issue
Block a user