2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-07 01:45:39 +00:00

Handle forum-non_forum changes in realtime.

This commit is contained in:
John Preston
2022-10-12 16:57:17 +04:00
parent 04d06e5b12
commit 6695eda1be
35 changed files with 286 additions and 499 deletions

View File

@@ -67,6 +67,18 @@ not_null<Dialogs::MainList*> Forum::topicsList() {
return &_topicsList;
}
rpl::producer<> Forum::destroyed() const {
return channel()->flagsValue(
) | rpl::filter([=](const ChannelData::Flags::Change &update) {
using Flag = ChannelData::Flag;
return (update.diff & Flag::Forum) && !(update.value & Flag::Forum);
}) | rpl::take(1) | rpl::to_empty;
}
rpl::producer<not_null<ForumTopic*>> Forum::topicDestroyed() const {
return _topicDestroyed.events();
}
void Forum::requestTopics() {
if (_allLoaded || _requestId) {
return;