Support forwarding to monoforums.

This commit is contained in:
John Preston
2025-05-13 18:18:24 +04:00
parent e17bf18350
commit 76db55ff19
36 changed files with 516 additions and 78 deletions
@@ -84,9 +84,9 @@ Entry::Entry(not_null<Data::Session*> owner, Type type)
, _flags((type == Type::History)
? (Flag::IsThread | Flag::IsHistory)
: (type == Type::ForumTopic)
? Flag::IsThread
? (Flag::IsThread | Flag::IsForumTopic)
: (type == Type::SavedSublist)
? Flag::IsSavedSublist
? (Flag::IsThread | Flag::IsSavedSublist)
: Flag(0)) {
}
@@ -113,7 +113,7 @@ Data::Forum *Entry::asForum() {
}
Data::Folder *Entry::asFolder() {
return (_flags & (Flag::IsThread | Flag::IsSavedSublist))
return (_flags & Flag::IsThread)
? nullptr
: static_cast<Data::Folder*>(this);
}
@@ -125,7 +125,7 @@ Data::Thread *Entry::asThread() {
}
Data::ForumTopic *Entry::asTopic() {
return ((_flags & Flag::IsThread) && !(_flags & Flag::IsHistory))
return (_flags & Flag::IsForumTopic)
? static_cast<Data::ForumTopic*>(this)
: nullptr;
}