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

Initial version of top peers.

This commit is contained in:
John Preston
2024-04-09 19:04:18 +04:00
parent 11e4c45969
commit 18598f8dca
21 changed files with 908 additions and 27 deletions

View File

@@ -21,6 +21,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/business/data_shortcut_messages.h"
#include "data/components/scheduled_messages.h"
#include "data/components/sponsored_messages.h"
#include "data/components/top_peers.h"
#include "data/notify/data_notify_settings.h"
#include "data/stickers/data_stickers.h"
#include "data/data_drafts.h"
@@ -429,9 +430,13 @@ not_null<HistoryItem*> History::createItem(
}
return result;
}
return message.match([&](const auto &data) {
const auto result = message.match([&](const auto &data) {
return makeMessage(id, data, localFlags);
});
if (result->out() && result->isRegular()) {
session().topPeers().increment(peer, result->date());
}
return result;
}
std::vector<not_null<HistoryItem*>> History::createItems(