RecentsViewController: Handle RoomsDirectoryCoordinatorBridgePresenter did select room id or alias.

This commit is contained in:
SBiOSoftWhare 2021-06-14 16:12:53 +02:00
parent 257fe62cf0
commit c8f6bddd08
3 changed files with 18 additions and 1 deletions

View file

@ -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";

View file

@ -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")

View file

@ -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