2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Improved display of history begin for channels with enabled auto-delete.

This commit is contained in:
23rd
2024-11-23 14:10:04 +03:00
parent 3e49b45418
commit 021a5881c2
2 changed files with 10 additions and 3 deletions

View File

@@ -459,8 +459,15 @@ std::vector<not_null<HistoryItem*>> History::createItems(
const auto detachExistingItem = true;
for (auto i = data.cend(), e = data.cbegin(); i != e;) {
const auto &data = *--i;
const auto id = IdFromMessage(data);
if ((id.bare == 1) && (data.type() == mtpc_messageEmpty)) {
// The first message of channels should be a service message
// about its creation. But if channel auto-cleaning is enabled,
// the first message comes empty and is displayed incorrectly.
continue;
}
result.emplace_back(createItem(
IdFromMessage(data),
id,
data,
localFlags,
detachExistingItem));