2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Move requestDialogEntry to Histories.

This commit is contained in:
John Preston
2020-02-21 11:58:50 +04:00
parent 9bdcd08233
commit db322cc19a
16 changed files with 198 additions and 183 deletions

View File

@@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_session.h"
#include "data/data_folder.h"
#include "data/data_location.h"
#include "data/data_histories.h"
#include "base/unixtime.h"
#include "history/history.h"
#include "observer_peer.h"
@@ -688,13 +689,14 @@ void ApplyChannelUpdate(
const auto folder = folderId
? channel->owner().folderLoaded(folderId)
: nullptr;
auto &histories = channel->owner().histories();
if (folder && history->folder() != folder) {
// If history folder is unknown or not synced, request both.
channel->session().api().requestDialogEntry(history);
channel->session().api().requestDialogEntry(folder);
histories.requestDialogEntry(history);
histories.requestDialogEntry(folder);
} else if (!history->folderKnown()
|| channel->pts() != update.vpts().v) {
channel->session().api().requestDialogEntry(history);
histories.requestDialogEntry(history);
} else {
history->applyDialogFields(
history->folder(),