mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 15:22:39 +00:00
Add support for reporting rooms on the room details screen too
This commit is contained in:
parent
94f187f5c2
commit
249478eb9f
15 changed files with 51 additions and 6 deletions
|
@ -592,6 +592,8 @@ Tap the + to start adding people.";
|
|||
"room_action_send_sticker" = "Send sticker";
|
||||
"room_action_send_file" = "Send file";
|
||||
"room_action_reply" = "Reply";
|
||||
"room_action_report" = "Report room";
|
||||
"room_action_report_prompt_reason" = "Reason for reporting this room";
|
||||
"room_replacement_information" = "This room has been replaced and is no longer active.";
|
||||
"room_replacement_link" = "The conversation continues here.";
|
||||
"room_predecessor_information" = "This room is a continuation of another conversation.";
|
||||
|
|
|
@ -5207,6 +5207,14 @@ public class VectorL10n: NSObject {
|
|||
public static var roomActionReply: String {
|
||||
return VectorL10n.tr("Vector", "room_action_reply")
|
||||
}
|
||||
/// Report room
|
||||
public static var roomActionReport: String {
|
||||
return VectorL10n.tr("Vector", "room_action_report")
|
||||
}
|
||||
/// Reason for reporting this room
|
||||
public static var roomActionReportPromptReason: String {
|
||||
return VectorL10n.tr("Vector", "room_action_report_prompt_reason")
|
||||
}
|
||||
/// Send file
|
||||
public static var roomActionSendFile: String {
|
||||
return VectorL10n.tr("Vector", "room_action_send_file")
|
||||
|
|
|
@ -224,6 +224,9 @@ extension RoomInfoCoordinator: RoomInfoListCoordinatorDelegate {
|
|||
self.delegate?.roomInfoCoordinatorDidLeaveRoom(self)
|
||||
}
|
||||
|
||||
func roomInfoListCoordinatorDidRequestReportRoom(_ coordinator: RoomInfoListCoordinatorType) {
|
||||
self.delegate?.roomInfoCoordinatorDidRequestReportRoom(self)
|
||||
}
|
||||
}
|
||||
|
||||
extension RoomInfoCoordinator: RoomParticipantsViewControllerDelegate {
|
||||
|
|
|
@ -25,6 +25,7 @@ import MatrixSDK
|
|||
func roomInfoCoordinatorBridgePresenterDelegateDidLeaveRoom(_ coordinatorBridgePresenter: RoomInfoCoordinatorBridgePresenter)
|
||||
func roomInfoCoordinatorBridgePresenter(_ coordinatorBridgePresenter: RoomInfoCoordinatorBridgePresenter, didReplaceRoomWithReplacementId roomId: String)
|
||||
func roomInfoCoordinatorBridgePresenter(_ coordinator: RoomInfoCoordinatorBridgePresenter, viewEventInTimeline event: MXEvent)
|
||||
func roomInfoCoordinatorBridgePresenterDidRequestReportRoom(_ coordinatorBridgePresenter: RoomInfoCoordinatorBridgePresenter)
|
||||
}
|
||||
|
||||
/// RoomInfoCoordinatorBridgePresenter enables to start RoomInfoCoordinator from a view controller.
|
||||
|
@ -131,9 +132,14 @@ extension RoomInfoCoordinatorBridgePresenter: RoomInfoCoordinatorDelegate {
|
|||
func roomInfoCoordinator(_ coordinator: RoomInfoCoordinatorType, didReplaceRoomWithReplacementId roomId: String) {
|
||||
self.delegate?.roomInfoCoordinatorBridgePresenter(self, didReplaceRoomWithReplacementId: roomId)
|
||||
}
|
||||
|
||||
func roomInfoCoordinator(_ coordinator: RoomInfoCoordinatorType, viewEventInTimeline event: MXEvent) {
|
||||
self.delegate?.roomInfoCoordinatorBridgePresenter(self, viewEventInTimeline: event)
|
||||
}
|
||||
|
||||
func roomInfoCoordinatorDidRequestReportRoom(_ coordinator: RoomInfoCoordinatorType) {
|
||||
self.delegate?.roomInfoCoordinatorBridgePresenterDidRequestReportRoom(self)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - UIAdaptivePresentationControllerDelegate
|
||||
|
|
|
@ -25,6 +25,7 @@ protocol RoomInfoCoordinatorDelegate: AnyObject {
|
|||
func roomInfoCoordinatorDidLeaveRoom(_ coordinator: RoomInfoCoordinatorType)
|
||||
func roomInfoCoordinator(_ coordinator: RoomInfoCoordinatorType, didReplaceRoomWithReplacementId roomId: String)
|
||||
func roomInfoCoordinator(_ coordinator: RoomInfoCoordinatorType, viewEventInTimeline event: MXEvent)
|
||||
func roomInfoCoordinatorDidRequestReportRoom(_ coordinator: RoomInfoCoordinatorType)
|
||||
}
|
||||
|
||||
/// `RoomInfoCoordinatorType` is a protocol describing a Coordinator that handle keybackup setup navigation flow.
|
||||
|
|
|
@ -75,4 +75,7 @@ extension RoomInfoListCoordinator: RoomInfoListViewModelCoordinatorDelegate {
|
|||
self.delegate?.roomInfoListCoordinatorDidLeaveRoom(self)
|
||||
}
|
||||
|
||||
func roomInfoListViewModelDidRequestReportRoom(_ viewModel: RoomInfoListViewModelType) {
|
||||
self.delegate?.roomInfoListCoordinatorDidRequestReportRoom(self)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ protocol RoomInfoListCoordinatorDelegate: AnyObject {
|
|||
func roomInfoListCoordinator(_ coordinator: RoomInfoListCoordinatorType, wantsToNavigateTo target: RoomInfoListTarget)
|
||||
func roomInfoListCoordinatorDidCancel(_ coordinator: RoomInfoListCoordinatorType)
|
||||
func roomInfoListCoordinatorDidLeaveRoom(_ coordinator: RoomInfoListCoordinatorType)
|
||||
func roomInfoListCoordinatorDidRequestReportRoom(_ coordinator: RoomInfoListCoordinatorType)
|
||||
}
|
||||
|
||||
/// `RoomInfoListCoordinatorType` is a protocol describing a Coordinator that handle key backup setup passphrase navigation flow.
|
||||
|
|
|
@ -48,4 +48,5 @@ enum RoomInfoListViewAction {
|
|||
case navigate(target: RoomInfoListTarget)
|
||||
case leave
|
||||
case cancel
|
||||
case report
|
||||
}
|
||||
|
|
|
@ -222,8 +222,16 @@ final class RoomInfoListViewController: UIViewController {
|
|||
rows: [rowLeave],
|
||||
footer: nil)
|
||||
|
||||
let rowReport = Row(type: .destructive, icon: Asset.Images.error.image, text: VectorL10n.roomEventActionReport, accessoryType: .disclosureIndicator) {
|
||||
self.viewModel.process(viewAction: .report)
|
||||
}
|
||||
let sectionReport = Section(header: nil,
|
||||
rows: [rowReport],
|
||||
footer: nil)
|
||||
|
||||
tmpSections.append(sectionSettings)
|
||||
tmpSections.append(sectionLeave)
|
||||
tmpSections.append(sectionReport)
|
||||
|
||||
sections = tmpSections
|
||||
}
|
||||
|
|
|
@ -79,6 +79,8 @@ final class RoomInfoListViewModel: NSObject, RoomInfoListViewModelType {
|
|||
self.leave()
|
||||
case .cancel:
|
||||
self.coordinatorDelegate?.roomInfoListViewModelDidCancel(self)
|
||||
case .report:
|
||||
self.coordinatorDelegate?.roomInfoListViewModelDidRequestReportRoom(self)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ protocol RoomInfoListViewModelCoordinatorDelegate: AnyObject {
|
|||
func roomInfoListViewModelDidCancel(_ viewModel: RoomInfoListViewModelType)
|
||||
func roomInfoListViewModelDidLeaveRoom(_ viewModel: RoomInfoListViewModelType)
|
||||
func roomInfoListViewModel(_ viewModel: RoomInfoListViewModelType, wantsToNavigateTo target: RoomInfoListTarget)
|
||||
func roomInfoListViewModelDidRequestReportRoom(_ viewModel: RoomInfoListViewModelType)
|
||||
}
|
||||
|
||||
/// Protocol describing the view model used by `RoomInfoListViewController`
|
||||
|
|
|
@ -5372,10 +5372,10 @@ static CGSize kThreadListBarButtonItemImageSize;
|
|||
}
|
||||
}
|
||||
|
||||
- (void)handleReportRoomButtonPress
|
||||
- (void)handleReportRoom
|
||||
{
|
||||
// Prompt user to enter a description of the problem content.
|
||||
UIAlertController *reportReasonAlert = [UIAlertController alertControllerWithTitle:[VectorL10n roomEventActionReportPromptReason]
|
||||
UIAlertController *reportReasonAlert = [UIAlertController alertControllerWithTitle:[VectorL10n roomActionReportPromptReason]
|
||||
message:nil
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
|
@ -5663,7 +5663,7 @@ static CGSize kThreadListBarButtonItemImageSize;
|
|||
}
|
||||
else if (tappedView == previewHeader.reportButton)
|
||||
{
|
||||
[self handleReportRoomButtonPress];
|
||||
[self handleReportRoom];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8032,6 +8032,11 @@ static CGSize kThreadListBarButtonItemImageSize;
|
|||
[self reloadRoomWihtEventId:event.eventId threadId:event.threadId forceUpdateRoomMarker:NO];
|
||||
}
|
||||
|
||||
- (void)roomInfoCoordinatorBridgePresenterDidRequestReportRoom:(RoomInfoCoordinatorBridgePresenter *)coordinatorBridgePresenter
|
||||
{
|
||||
[self handleReportRoom];
|
||||
}
|
||||
|
||||
-(void)reloadRoomWihtEventId:(NSString *)eventId
|
||||
threadId:(NSString *)threadId
|
||||
forceUpdateRoomMarker:(BOOL)forceUpdateRoomMarker
|
||||
|
|
|
@ -51,8 +51,8 @@
|
|||
[self.rightButton setTitle:[VectorL10n join] forState:UIControlStateNormal];
|
||||
[self.rightButton setTitle:[VectorL10n join] forState:UIControlStateHighlighted];
|
||||
|
||||
[self.reportButton setTitle:[VectorL10n roomEventActionReport] forState:UIControlStateNormal];
|
||||
[self.reportButton setTitle:[VectorL10n roomEventActionReport] forState:UIControlStateHighlighted];
|
||||
[self.reportButton setTitle:[VectorL10n roomActionReport] forState:UIControlStateNormal];
|
||||
[self.reportButton setTitle:[VectorL10n roomActionReport] forState:UIControlStateHighlighted];
|
||||
|
||||
tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(reportTapGesture:)];
|
||||
[tap setNumberOfTouchesRequired:1];
|
||||
|
|
|
@ -520,8 +520,12 @@ extension ExploreRoomCoordinator: RoomInfoCoordinatorDelegate {
|
|||
self.remove(childCoordinator: coordinator)
|
||||
}
|
||||
}
|
||||
|
||||
func roomInfoCoordinator(_ coordinator: RoomInfoCoordinatorType, viewEventInTimeline event: MXEvent) {
|
||||
|
||||
}
|
||||
|
||||
func roomInfoCoordinatorDidRequestReportRoom(_ coordinator: RoomInfoCoordinatorType) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit eea06ab5f2b68223f557abaf04674df7f952ede8
|
||||
Subproject commit 3052a396b88095cbcfe1b4f488127f69e3280cda
|
Loading…
Reference in a new issue