mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Allow hiding members list in groups.
This commit is contained in:
@@ -577,7 +577,10 @@ bool ChannelData::allowsForwarding() const {
|
||||
}
|
||||
|
||||
bool ChannelData::canViewMembers() const {
|
||||
return flags() & Flag::CanViewParticipants;
|
||||
return (flags() & Flag::CanViewParticipants)
|
||||
&& (!(flags() & Flag::ParticipantsHidden)
|
||||
|| amCreator()
|
||||
|| hasAdminRights());
|
||||
}
|
||||
|
||||
bool ChannelData::canViewAdmins() const {
|
||||
@@ -944,14 +947,20 @@ void ApplyChannelUpdate(
|
||||
| Flag::CanSetStickers
|
||||
| Flag::PreHistoryHidden
|
||||
| Flag::AntiSpam
|
||||
| Flag::Location;
|
||||
| Flag::Location
|
||||
| Flag::ParticipantsHidden;
|
||||
channel->setFlags((channel->flags() & ~mask)
|
||||
| (update.is_can_set_username() ? Flag::CanSetUsername : Flag())
|
||||
| (update.is_can_view_participants() ? Flag::CanViewParticipants : Flag())
|
||||
| (update.is_can_view_participants()
|
||||
? Flag::CanViewParticipants
|
||||
: Flag())
|
||||
| (update.is_can_set_stickers() ? Flag::CanSetStickers : Flag())
|
||||
| (update.is_hidden_prehistory() ? Flag::PreHistoryHidden : Flag())
|
||||
| (update.is_antispam() ? Flag::AntiSpam : Flag())
|
||||
| (update.vlocation() ? Flag::Location : Flag()));
|
||||
| (update.vlocation() ? Flag::Location : Flag())
|
||||
| (update.is_participants_hidden()
|
||||
? Flag::ParticipantsHidden
|
||||
: Flag()));
|
||||
channel->setUserpicPhoto(update.vchat_photo());
|
||||
if (const auto migratedFrom = update.vmigrated_from_chat_id()) {
|
||||
channel->addFlags(Flag::Megagroup);
|
||||
|
@@ -58,6 +58,7 @@ enum class ChannelDataFlag {
|
||||
RequestToJoin = (1 << 22),
|
||||
Forum = (1 << 23),
|
||||
AntiSpam = (1 << 24),
|
||||
ParticipantsHidden = (1 << 25),
|
||||
};
|
||||
inline constexpr bool is_flag_type(ChannelDataFlag) { return true; };
|
||||
using ChannelDataFlags = base::flags<ChannelDataFlag>;
|
||||
|
Reference in New Issue
Block a user