mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-03-04 05:17:55 +00:00
Fix adding first chat to archive.
This commit is contained in:
parent
52b9212625
commit
4c571f5bff
@ -101,10 +101,13 @@ void Folder::indexNameParts() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Folder::registerOne(not_null<History*> history) {
|
void Folder::registerOne(not_null<History*> history) {
|
||||||
|
++_chatListViewVersion;
|
||||||
if (_chatsList.indexed()->size() == 1) {
|
if (_chatsList.indexed()->size() == 1) {
|
||||||
updateChatListSortPosition();
|
updateChatListSortPosition();
|
||||||
|
if (!_cloudUnread.messagesCount.has_value()) {
|
||||||
|
session().api().requestDialogEntry(this);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
++_chatListViewVersion;
|
|
||||||
updateChatListEntry();
|
updateChatListEntry();
|
||||||
}
|
}
|
||||||
applyChatListMessage(history->chatListMessage());
|
applyChatListMessage(history->chatListMessage());
|
||||||
@ -315,6 +318,7 @@ TimeId Folder::adjustedChatListTimeId() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Folder::applyDialog(const MTPDdialogFolder &data) {
|
void Folder::applyDialog(const MTPDdialogFolder &data) {
|
||||||
|
updateCloudUnread(data);
|
||||||
if (const auto peerId = peerFromMTP(data.vpeer)) {
|
if (const auto peerId = peerFromMTP(data.vpeer)) {
|
||||||
const auto history = owner().history(peerId);
|
const auto history = owner().history(peerId);
|
||||||
const auto fullId = FullMsgId(
|
const auto fullId = FullMsgId(
|
||||||
@ -325,7 +329,6 @@ void Folder::applyDialog(const MTPDdialogFolder &data) {
|
|||||||
_chatsList.clear();
|
_chatsList.clear();
|
||||||
updateChatListExistence();
|
updateChatListExistence();
|
||||||
}
|
}
|
||||||
updateCloudUnread(data);
|
|
||||||
if (_chatsList.indexed()->size() < kLoadedChatsMinCount) {
|
if (_chatsList.indexed()->size() < kLoadedChatsMinCount) {
|
||||||
session().api().requestDialogs(this);
|
session().api().requestDialogs(this);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user