From c5aab876ad1c0b1942dc496de58fd08be3e9e995 Mon Sep 17 00:00:00 2001 From: manuroe Date: Fri, 9 Mar 2018 18:31:17 +0100 Subject: [PATCH] BF: Cannot join from a room preview for room with a long topic (#1645) If necessary, crop the room name in "You are trying to access %@. Would you like to join in order to participate in the discussion?" so that it does not eat all the screen. --- Riot/Views/RoomTitle/PreviewRoomTitleView.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Riot/Views/RoomTitle/PreviewRoomTitleView.m b/Riot/Views/RoomTitle/PreviewRoomTitleView.m index 7b723562b3..d719a1ba05 100644 --- a/Riot/Views/RoomTitle/PreviewRoomTitleView.m +++ b/Riot/Views/RoomTitle/PreviewRoomTitleView.m @@ -147,6 +147,13 @@ - (void)refreshDisplay { roomName = NSLocalizedStringFromTable(@"room_preview_try_join_an_unknown_room_default", @"Vector", nil); } + else if (roomName.length > 20) + { + // Would have nice to get the cropped string displayed by self.displayNameTextField + // but the value is not accessible. Cut it off by hand + roomName = [NSString stringWithFormat:@"%@…",[roomName substringToIndex:20]]; + } + self.previewLabel.text = [NSString stringWithFormat:NSLocalizedStringFromTable(@"room_preview_try_join_an_unknown_room", @"Vector", nil), roomName]; } }