Allow reaction reports in public groups.

This commit is contained in:
John Preston 2024-02-01 17:51:54 +04:00
parent 5401d00548
commit cdaa23363f
1 changed files with 8 additions and 4 deletions

View File

@ -724,16 +724,20 @@ void DetailsFiller::addReportReaction(Ui::MultiSlideTracker &tracker) {
const auto user = _peer->asUser();
if (_peer->isSelf()) {
return;
#if 0 // Only public groups allow reaction reports for now.
} else if (const auto chat = data.group->asChat()) {
const auto ban = chat->canBanMembers()
&& (!user || !chat->admins.contains(_peer))
&& (!user || chat->creator != user->id);
addReportReaction(data, ban, tracker);
#endif
} else if (const auto channel = data.group->asMegagroup()) {
const auto ban = channel->canBanMembers()
&& (!user || !channel->mgInfo->admins.contains(user->id))
&& (!user || channel->mgInfo->creator != user);
addReportReaction(data, ban, tracker);
if (channel->isPublic()) {
const auto ban = channel->canBanMembers()
&& (!user || !channel->mgInfo->admins.contains(user->id))
&& (!user || channel->mgInfo->creator != user);
addReportReaction(data, ban, tracker);
}
}
}, [](const auto &) {});
}