mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Track forum unread state by topics inside.
This commit is contained in:
@@ -66,7 +66,9 @@ Data::ChatBotCommands::Changed MegagroupInfo::setBotCommands(
|
||||
|
||||
void MegagroupInfo::ensureForum(not_null<ChannelData*> that) {
|
||||
if (!_forum) {
|
||||
_forum = std::make_unique<Data::Forum>(that->owner().history(that));
|
||||
const auto history = that->owner().history(that);
|
||||
_forum = std::make_unique<Data::Forum>(history);
|
||||
history->forumChanged(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +77,12 @@ Data::Forum *MegagroupInfo::forum() const {
|
||||
}
|
||||
|
||||
std::unique_ptr<Data::Forum> MegagroupInfo::takeForumData() {
|
||||
return std::move(_forum);
|
||||
if (auto result = base::take(_forum)) {
|
||||
result->history()->forumChanged(result.get());
|
||||
return result;
|
||||
}
|
||||
return nullptr;
|
||||
|
||||
}
|
||||
|
||||
ChannelData::ChannelData(not_null<Data::Session*> owner, PeerId id)
|
||||
|
Reference in New Issue
Block a user