mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Add banning from reaction report
This commit is contained in:
parent
d39317aa4c
commit
e6881a78dc
@ -12104,3 +12104,9 @@ Sorry for the inconvenience.";
|
|||||||
"Channel.AdminLog.MessageManyDeleted.HideAll" = "hide all";
|
"Channel.AdminLog.MessageManyDeleted.HideAll" = "hide all";
|
||||||
|
|
||||||
"Shortcut.AppIcon" = "Edit App Icon";
|
"Shortcut.AppIcon" = "Edit App Icon";
|
||||||
|
|
||||||
|
"ReportPeer.BanAndReport" = "Ban and Report";
|
||||||
|
|
||||||
|
"ReportPeer.ReportReaction.Text" = "Are you sure you want to report reactions from this user?";
|
||||||
|
"ReportPeer.ReportReaction.BanAndReport" = "Ban and Report";
|
||||||
|
"ReportPeer.ReportReaction.Report" = "Report Reaction";
|
||||||
|
@ -1370,7 +1370,7 @@ private func infoItems(data: PeerInfoScreenData?, context: AccountContext, prese
|
|||||||
interaction.openChat(nil)
|
interaction.openChat(nil)
|
||||||
}))
|
}))
|
||||||
|
|
||||||
items[.peerInfo]!.append(PeerInfoScreenActionItem(id: 4, text: presentationData.strings.ReportPeer_ReportReaction, color: .destructive, action: {
|
items[.peerInfo]!.append(PeerInfoScreenActionItem(id: 4, text: presentationData.strings.ReportPeer_BanAndReport, color: .destructive, action: {
|
||||||
interaction.openReport(.reaction(reactionSourceMessageId))
|
interaction.openReport(.reaction(reactionSourceMessageId))
|
||||||
}))
|
}))
|
||||||
} else if let _ = nearbyPeerDistance {
|
} else if let _ = nearbyPeerDistance {
|
||||||
@ -8004,13 +8004,39 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, PeerInfoScreenNodePro
|
|||||||
|
|
||||||
switch type {
|
switch type {
|
||||||
case let .reaction(sourceMessageId):
|
case let .reaction(sourceMessageId):
|
||||||
let _ = (self.context.engine.peers.reportPeerReaction(authorId: self.peerId, messageId: sourceMessageId)
|
let presentationData = self.presentationData
|
||||||
|> deliverOnMainQueue).startStandalone(completed: { [weak self] in
|
let actionSheet = ActionSheetController(presentationData: presentationData)
|
||||||
guard let strongSelf = self else {
|
let dismissAction: () -> Void = { [weak actionSheet] in
|
||||||
return
|
actionSheet?.dismissAnimated()
|
||||||
}
|
}
|
||||||
strongSelf.controller?.present(UndoOverlayController(presentationData: strongSelf.presentationData, content: .emoji(name: "PoliceCar", text: strongSelf.presentationData.strings.Report_Succeed), elevatedLayout: false, action: { _ in return false }), in: .current)
|
actionSheet.setItemGroups([
|
||||||
})
|
ActionSheetItemGroup(items: [
|
||||||
|
ActionSheetTextItem(title: presentationData.strings.ReportPeer_ReportReaction_Text),
|
||||||
|
ActionSheetButtonItem(title: presentationData.strings.ReportPeer_ReportReaction_BanAndReport, color: .destructive, action: { [weak self] in
|
||||||
|
dismissAction()
|
||||||
|
guard let self else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
self.activeActionDisposable.set(self.context.engine.privacy.requestUpdatePeerIsBlocked(peerId: self.peerId, isBlocked: true).startStrict())
|
||||||
|
self.controller?.present(UndoOverlayController(presentationData: self.presentationData, content: .emoji(name: "PoliceCar", text: self.presentationData.strings.Report_Succeed), elevatedLayout: false, action: { _ in return false }), in: .current)
|
||||||
|
}),
|
||||||
|
ActionSheetButtonItem(title: presentationData.strings.ReportPeer_ReportReaction_Report, action: { [weak self] in
|
||||||
|
dismissAction()
|
||||||
|
guard let self else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let _ = (self.context.engine.peers.reportPeerReaction(authorId: self.peerId, messageId: sourceMessageId)
|
||||||
|
|> deliverOnMainQueue).startStandalone(completed: { [weak self] in
|
||||||
|
guard let strongSelf = self else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
strongSelf.controller?.present(UndoOverlayController(presentationData: strongSelf.presentationData, content: .emoji(name: "PoliceCar", text: strongSelf.presentationData.strings.Report_Succeed), elevatedLayout: false, action: { _ in return false }), in: .current)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
]),
|
||||||
|
ActionSheetItemGroup(items: [ActionSheetButtonItem(title: presentationData.strings.Common_Cancel, action: { dismissAction() })])
|
||||||
|
])
|
||||||
|
self.controller?.present(actionSheet, in: .window(.root))
|
||||||
default:
|
default:
|
||||||
let options: [PeerReportOption]
|
let options: [PeerReportOption]
|
||||||
if case .user = type {
|
if case .user = type {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user