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

Fix client side generated changelogs display.

Also use message date if available in MediaView.
This commit is contained in:
John Preston
2018-09-27 23:31:48 +03:00
parent 352fc55234
commit a70613d929
17 changed files with 141 additions and 198 deletions

View File

@@ -610,11 +610,23 @@ void ApiWrap::requestDialogEntry(not_null<Data::Feed*> feed) {
// }).send();
//}
void ApiWrap::requestDialogEntry(not_null<History*> history) {
if (_dialogRequests.contains(history)) {
void ApiWrap::requestDialogEntry(
not_null<History*> history,
Fn<void()> callback) {
const auto[i, ok] = _dialogRequests.try_emplace(history);
if (callback) {
i->second.push_back(std::move(callback));
}
if (!ok) {
return;
}
_dialogRequests.emplace(history);
const auto finalize = [=] {
if (const auto callbacks = _dialogRequests.take(history)) {
for (const auto callback : *callbacks) {
callback();
}
}
};
auto peers = QVector<MTPInputDialogPeer>(
1,
MTP_inputDialogPeer(history->peer->input));
@@ -623,9 +635,9 @@ void ApiWrap::requestDialogEntry(not_null<History*> history) {
)).done([=](const MTPmessages_PeerDialogs &result) {
applyPeerDialogs(result);
historyDialogEntryApplied(history);
_dialogRequests.remove(history);
finalize();
}).fail([=](const RPCError &error) {
_dialogRequests.remove(history);
finalize();
}).send();
}