Support bots as community linked peers

This commit is contained in:
John Preston
2026-07-07 11:57:16 +04:00
parent 3e003fb090
commit 7ad96f25df
15 changed files with 256 additions and 165 deletions
@@ -96,6 +96,15 @@ bool IsCommunityChatViewable(const CommunityLinkedPeer &linked) {
return linked.canViewHistory;
}
ChannelId PeerLinkedCommunityId(not_null<PeerData*> peer) {
if (const auto channel = peer->asChannel()) {
return channel->linkedCommunityId();
} else if (const auto user = peer->asUser()) {
return user->linkedCommunityId();
}
return ChannelId();
}
CommunityInfo::CommunityInfo(not_null<ChannelData*> channel)
: _channel(channel)
, _chatsList(