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

Update API scheme & fix monoforum send.

This commit is contained in:
John Preston
2025-05-09 13:46:14 +04:00
parent f8913bf9b9
commit abcf7e3a47
14 changed files with 102 additions and 22 deletions

View File

@@ -372,18 +372,19 @@ void Session::clear() {
// Optimization: clear notifications before destroying items.
Core::App().notifications().clearFromSession(_session);
// We must clear all forums before clearing customEmojiManager.
// We must clear all [mono]forums before clearing customEmojiManager.
// Because in Data::ForumTopic an Ui::Text::CustomEmoji is cached.
auto forums = base::flat_set<not_null<ChannelData*>>();
for (const auto &[peerId, peer] : _peers) {
if (const auto channel = peer->asChannel()) {
if (channel->isForum()) {
if (channel->isForum() || channel->isMonoforum()) {
forums.emplace(channel);
}
}
}
for (const auto &channel : forums) {
channel->setFlags(channel->flags() & ~ChannelDataFlag::Forum);
channel->setFlags(channel->flags()
& ~(ChannelDataFlag::Forum | ChannelDataFlag::Monoforum));
}
_sendActionManager->clear();