mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-06 11:52:58 +00:00
Mark hidden chats with a userpic badge in community view.
This commit is contained in:
@@ -132,6 +132,13 @@ void CommunityInfo::applyLinkedPeers(const QVector<MTPCommunityPeer> &list) {
|
||||
}
|
||||
_linkedPeers = std::move(now);
|
||||
|
||||
_hiddenPeers.clear();
|
||||
for (const auto &linked : _linkedPeers) {
|
||||
if (linked.visible.has_value() && !*linked.visible) {
|
||||
_hiddenPeers.emplace(linked.peer);
|
||||
}
|
||||
}
|
||||
|
||||
const auto communityId = peerToChannel(_channel->id);
|
||||
for (const auto &linked : _linkedPeers) {
|
||||
if (const auto channel = linked.peer->asChannel()) {
|
||||
@@ -163,6 +170,10 @@ rpl::producer<> CommunityInfo::linkedPeersValue() const {
|
||||
) | rpl::then(_linkedPeersChanges.events());
|
||||
}
|
||||
|
||||
bool CommunityInfo::isHidden(not_null<PeerData*> peer) const {
|
||||
return _hiddenPeers.contains(peer);
|
||||
}
|
||||
|
||||
bool CommunityInfo::collapsedInDialogs() const {
|
||||
return _channel->flags() & ChannelDataFlag::CommunityCollapsed;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user