mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-06 11:52:58 +00:00
Delete reactions from menu / list.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user