diff --git a/Riot/Assets/en.lproj/Vector.strings b/Riot/Assets/en.lproj/Vector.strings index e06b7db2e..986bd6a22 100644 --- a/Riot/Assets/en.lproj/Vector.strings +++ b/Riot/Assets/en.lproj/Vector.strings @@ -195,6 +195,7 @@ "room_recents_join_room" = "Join room"; "room_recents_join_room_title" = "Join a room"; "room_recents_join_room_prompt" = "Type a room id or a room alias"; +"room_recents_unknown_room_error_message" = "Can't find this room. Make sure it exists"; // People tab "people_invites_section" = "INVITES"; diff --git a/Riot/Generated/Strings.swift b/Riot/Generated/Strings.swift index 4f93cded7..c2e0b8beb 100644 --- a/Riot/Generated/Strings.swift +++ b/Riot/Generated/Strings.swift @@ -3354,6 +3354,10 @@ internal enum VectorL10n { internal static var roomRecentsStartChatWith: String { return VectorL10n.tr("Vector", "room_recents_start_chat_with") } + /// Can't find this room. Make sure it exists + internal static var roomRecentsUnknownRoomErrorMessage: String { + return VectorL10n.tr("Vector", "room_recents_unknown_room_error_message") + } /// This room has been replaced and is no longer active. internal static var roomReplacementInformation: String { return VectorL10n.tr("Vector", "room_replacement_information") diff --git a/Riot/Modules/Common/Recents/RecentsViewController.m b/Riot/Modules/Common/Recents/RecentsViewController.m index 785f1306d..a063548a5 100644 --- a/Riot/Modules/Common/Recents/RecentsViewController.m +++ b/Riot/Modules/Common/Recents/RecentsViewController.m @@ -2175,7 +2175,19 @@ - (void)roomsDirectoryCoordinatorBridgePresenterDelegate:(RoomsDirectoryCoordinatorBridgePresenter *)coordinatorBridgePresenter didSelectRoomWithIdOrAlias:(NSString * _Nonnull)roomIdOrAlias { - // TODO: Implement + MXRoom *room = [self.mainSession vc_roomWithIdOrAlias:roomIdOrAlias]; + + if (room) + { + [coordinatorBridgePresenter dismissWithAnimated:YES completion:^{ + [[AppDelegate theDelegate] showRoom:room.roomId andEventId:nil withMatrixSession:self.mainSession restoreInitialDisplay:NO]; + }]; + coordinatorBridgePresenter = nil; + } + else + { + [[AppDelegate theDelegate] showAlertWithTitle:[NSBundle mxk_localizedStringForKey:@"error"] message:NSLocalizedStringFromTable(@"room_recents_unknown_room_error_message", @"Vector", nil)]; + } } @end