Delete reactions from menu / list.

This commit is contained in:
John Preston
2026-04-23 14:16:47 +07:00
parent eeae44810c
commit 553ecdd5f7
13 changed files with 855 additions and 130 deletions
+28
View File
@@ -144,6 +144,34 @@ auto CreateReportMessagesOrStoriesCallback(
};
}
ReactionReportCapabilities GetReactionReportCapabilities(
not_null<PeerData*> group,
not_null<PeerData*> participant) {
const auto channel = group->asMegagroup();
return channel
? ReactionReportCapabilities{
.canReport = channel->isPublic() && !participant->isSelf(),
.canBan = channel->canRestrictParticipant(participant),
}
: ReactionReportCapabilities();
}
void ReportReaction(
std::shared_ptr<Ui::Show> show,
not_null<PeerData*> group,
MsgId messageId,
not_null<PeerData*> participant) {
group->session().api().request(MTPmessages_ReportReaction(
group->input(),
MTP_int(messageId.bare),
participant->input()
)).done([=] {
if (show) {
show->showToast(tr::lng_report_thanks(tr::now));
}
}).send();
}
void ReportSpam(
not_null<PeerData*> sender,
const MessageIdsList &ids) {