diff --git a/Riot/Generated/Strings.swift b/Riot/Generated/Strings.swift index 7cdd90ad54..6891446ae4 100644 --- a/Riot/Generated/Strings.swift +++ b/Riot/Generated/Strings.swift @@ -2084,23 +2084,23 @@ public class VectorL10n: NSObject { return VectorL10n.tr("Vector", "leave") } /// Leave all rooms and spaces - internal static var leaveSpaceAndAllRoomsAction: String { + public static var leaveSpaceAndAllRoomsAction: String { return VectorL10n.tr("Vector", "leave_space_and_all_rooms_action") } /// Are you sure you want to leave %@? Do you also want to leave all rooms and spaces of this space? - internal static func leaveSpaceMessage(_ p1: String) -> String { + public static func leaveSpaceMessage(_ p1: String) -> String { return VectorL10n.tr("Vector", "leave_space_message", p1) } /// You are admin of this space, ensure that you have transferred admin right to another member before leaving. - internal static var leaveSpaceMessageAdminWarning: String { + public static var leaveSpaceMessageAdminWarning: String { return VectorL10n.tr("Vector", "leave_space_message_admin_warning") } /// Don't leave any rooms - internal static var leaveSpaceOnlyAction: String { + public static var leaveSpaceOnlyAction: String { return VectorL10n.tr("Vector", "leave_space_only_action") } /// Leave %@ - internal static func leaveSpaceTitle(_ p1: String) -> String { + public static func leaveSpaceTitle(_ p1: String) -> String { return VectorL10n.tr("Vector", "leave_space_title", p1) } /// Less @@ -2212,7 +2212,7 @@ public class VectorL10n: NSObject { return VectorL10n.tr("Vector", "on") } /// Open - internal static var `open`: String { + public static var `open`: String { return VectorL10n.tr("Vector", "open") } /// or @@ -3444,7 +3444,7 @@ public class VectorL10n: NSObject { return VectorL10n.tr("Vector", "room_recents_start_chat_with") } /// SUGGESTED ROOMS - internal static var roomRecentsSuggestedRoomsSection: String { + public static var roomRecentsSuggestedRoomsSection: String { return VectorL10n.tr("Vector", "room_recents_suggested_rooms_section") } /// Can't find this room. Make sure it exists @@ -4820,11 +4820,11 @@ public class VectorL10n: NSObject { return VectorL10n.tr("Vector", "social_login_list_title_sign_up") } /// Change space avatar - internal static var spaceAvatarViewAccessibilityHint: String { + public static var spaceAvatarViewAccessibilityHint: String { return VectorL10n.tr("Vector", "space_avatar_view_accessibility_hint") } /// avatar - internal static var spaceAvatarViewAccessibilityLabel: String { + public static var spaceAvatarViewAccessibilityLabel: String { return VectorL10n.tr("Vector", "space_avatar_view_accessibility_label") } /// BETA @@ -4856,75 +4856,75 @@ public class VectorL10n: NSObject { return VectorL10n.tr("Vector", "space_feature_unavailable_title") } /// Ban from this space - internal static var spaceParticipantsActionBan: String { + public static var spaceParticipantsActionBan: String { return VectorL10n.tr("Vector", "space_participants_action_ban") } /// Remove from this space - internal static var spaceParticipantsActionRemove: String { + public static var spaceParticipantsActionRemove: String { return VectorL10n.tr("Vector", "space_participants_action_remove") } /// Private space - internal static var spacePrivateJoinRule: String { + public static var spacePrivateJoinRule: String { return VectorL10n.tr("Vector", "space_private_join_rule") } /// Public space - internal static var spacePublicJoinRule: String { + public static var spacePublicJoinRule: String { return VectorL10n.tr("Vector", "space_public_join_rule") } /// space - internal static var spaceTag: String { + public static var spaceTag: String { return VectorL10n.tr("Vector", "space_tag") } /// Adding rooms coming soon - internal static var spacesAddRoomsComingSoonTitle: String { + public static var spacesAddRoomsComingSoonTitle: String { return VectorL10n.tr("Vector", "spaces_add_rooms_coming_soon_title") } /// This feature hasn’t been implemented here, but it’s on the way. For now, you can do that with Element on your computer. - internal static var spacesComingSoonDetail: String { + public static var spacesComingSoonDetail: String { return VectorL10n.tr("Vector", "spaces_coming_soon_detail") } /// Coming soon - internal static var spacesComingSoonTitle: String { + public static var spacesComingSoonTitle: String { return VectorL10n.tr("Vector", "spaces_coming_soon_title") } /// Some rooms may be hidden because they’re private and you need an invite. - internal static var spacesEmptySpaceDetail: String { + public static var spacesEmptySpaceDetail: String { return VectorL10n.tr("Vector", "spaces_empty_space_detail") } /// This space has no rooms (yet) - internal static var spacesEmptySpaceTitle: String { + public static var spacesEmptySpaceTitle: String { return VectorL10n.tr("Vector", "spaces_empty_space_title") } /// Explore rooms - internal static var spacesExploreRooms: String { + public static var spacesExploreRooms: String { return VectorL10n.tr("Vector", "spaces_explore_rooms") } /// Home - internal static var spacesHomeSpaceTitle: String { + public static var spacesHomeSpaceTitle: String { return VectorL10n.tr("Vector", "spaces_home_space_title") } /// Invites coming soon - internal static var spacesInvitesComingSoonTitle: String { + public static var spacesInvitesComingSoonTitle: String { return VectorL10n.tr("Vector", "spaces_invites_coming_soon_title") } /// Spaces - internal static var spacesLeftPanelTitle: String { + public static var spacesLeftPanelTitle: String { return VectorL10n.tr("Vector", "spaces_left_panel_title") } /// Looking for someone not in %@? For now, you can invite them on web or desktop. - internal static func spacesNoMemberFoundDetail(_ p1: String) -> String { + public static func spacesNoMemberFoundDetail(_ p1: String) -> String { return VectorL10n.tr("Vector", "spaces_no_member_found_detail", p1) } /// No results found - internal static var spacesNoResultFoundTitle: String { + public static var spacesNoResultFoundTitle: String { return VectorL10n.tr("Vector", "spaces_no_result_found_title") } /// Some results may be hidden because they’re private and you need an invite to join them. - internal static var spacesNoRoomFoundDetail: String { + public static var spacesNoRoomFoundDetail: String { return VectorL10n.tr("Vector", "spaces_no_room_found_detail") } /// Suggested - internal static var spacesSuggestedRoom: String { + public static var spacesSuggestedRoom: String { return VectorL10n.tr("Vector", "spaces_suggested_room") } /// Start diff --git a/Riot/Modules/Application/LegacyAppDelegate.m b/Riot/Modules/Application/LegacyAppDelegate.m index 6134f930a4..1ad7847f8c 100644 --- a/Riot/Modules/Application/LegacyAppDelegate.m +++ b/Riot/Modules/Application/LegacyAppDelegate.m @@ -1365,9 +1365,9 @@ - (BOOL)handleUniversalLinkFragment:(NSString*)fragment fromURL:(NSURL*)universa // So, come back to the home VC and show its loading wheel while processing [self restoreInitialDisplay:^{ - if ([_masterTabBarController.selectedViewController isKindOfClass:MXKViewController.class]) + if ([_masterTabBarController.selectedViewController isKindOfClass:MXKActivityHandlingViewController.class]) { - MXKViewController *homeViewController = (MXKViewController*)_masterTabBarController.selectedViewController; + MXKActivityHandlingViewController *homeViewController = (MXKActivityHandlingViewController*)_masterTabBarController.selectedViewController; [homeViewController startActivityIndicator]; @@ -1469,7 +1469,7 @@ - (BOOL)handleUniversalLinkFragment:(NSString*)fragment fromURL:(NSURL*)universa self.spaceDetailPresenter = [SpaceDetailPresenter new]; self.spaceDetailPresenter.delegate = self; - [self.spaceDetailPresenter presentForSpaceWithSummary:room from:self.masterNavigationController sourceView:nil session:account.mxSession animated:YES]; + [self.spaceDetailPresenter presentForSpaceWithPublicRoom:room from:self.masterNavigationController sourceView:nil session:account.mxSession animated:YES]; } else { diff --git a/Riot/Modules/Home/VersionCheck/HomeViewControllerWithBannerWrapperViewController.swift b/Riot/Modules/Home/VersionCheck/HomeViewControllerWithBannerWrapperViewController.swift index b053887e46..85abec4d1a 100644 --- a/Riot/Modules/Home/VersionCheck/HomeViewControllerWithBannerWrapperViewController.swift +++ b/Riot/Modules/Home/VersionCheck/HomeViewControllerWithBannerWrapperViewController.swift @@ -16,7 +16,7 @@ import Foundation -class HomeViewControllerWithBannerWrapperViewController: MXKViewController, BannerPresentationProtocol { +class HomeViewControllerWithBannerWrapperViewController: MXKActivityHandlingViewController, BannerPresentationProtocol { @objc let homeViewController: HomeViewController private var bannerContainerView: UIView! diff --git a/Riot/Modules/Room/RoomViewController+Spaces.swift b/Riot/Modules/Room/RoomViewController+Spaces.swift index 9c6ba551f1..fac30e7978 100644 --- a/Riot/Modules/Room/RoomViewController+Spaces.swift +++ b/Riot/Modules/Room/RoomViewController+Spaces.swift @@ -94,14 +94,14 @@ extension RoomViewController { return } - self.requestSummary(forRoomWithId: roomId, via: viaServers, from: url) + self.requestSummaryAndShowSpaceDetail(forRoomWithId: roomId, via: viaServers, from: url) } } else { - self.requestSummary(forRoomWithId: roomIdOrAlias, via: viaServers, from: url) + self.requestSummaryAndShowSpaceDetail(forRoomWithId: roomIdOrAlias, via: viaServers, from: url) } } - private func requestSummary(forRoomWithId roomId: String, via: [String], from url: URL?) { + private func requestSummaryAndShowSpaceDetail(forRoomWithId roomId: String, via: [String], from url: URL?) { if self.mainSession.spaceService.getSpace(withId: roomId) != nil { self.stopActivityIndicator() self.showSpaceDetail(withId: roomId) diff --git a/Riot/Modules/Room/RoomViewController.m b/Riot/Modules/Room/RoomViewController.m index 6811ad1960..8e574e082d 100644 --- a/Riot/Modules/Room/RoomViewController.m +++ b/Riot/Modules/Room/RoomViewController.m @@ -2195,7 +2195,6 @@ - (BOOL)handleUniversalLinkURL:(NSURL*)universalLinkURL { [self handleSpaceUniversalLinkWith:universalLinkURL]; return YES; -// return [[AppDelegate theDelegate] handleUniversalLinkURL:universalLinkURL]; } } @@ -6487,7 +6486,7 @@ - (void)showSpaceDetailWithPublicRoom:(MXPublicRoom *)publicRoom { self.spaceDetailPresenter = [SpaceDetailPresenter new]; self.spaceDetailPresenter.delegate = self; - [self.spaceDetailPresenter presentForSpaceWithSummary:publicRoom from:self sourceView:nil session:self.mainSession animated:YES]; + [self.spaceDetailPresenter presentForSpaceWithPublicRoom:publicRoom from:self sourceView:nil session:self.mainSession animated:YES]; } - (void)showSpaceDetailWithId:(NSString *)spaceId diff --git a/Riot/Modules/Spaces/SpaceDetail/SpaceDetailPresenter.swift b/Riot/Modules/Spaces/SpaceDetail/SpaceDetailPresenter.swift index b99d20e36b..39a331bc92 100644 --- a/Riot/Modules/Spaces/SpaceDetail/SpaceDetailPresenter.swift +++ b/Riot/Modules/Spaces/SpaceDetail/SpaceDetailPresenter.swift @@ -59,15 +59,15 @@ class SpaceDetailPresenter: NSObject { self.show(with: session) } - @objc func present(forSpaceWithSummary spaceSummary: MXPublicRoom, + @objc func present(forSpaceWithPublicRoom publicRoom: MXPublicRoom, from viewController: UIViewController, sourceView: UIView?, session: MXSession, animated: Bool) { self.session = session - self.spaceId = spaceSummary.roomId + self.spaceId = publicRoom.roomId - self.viewModel = SpaceDetailViewModel(session: session, publicRoom: spaceSummary) + self.viewModel = SpaceDetailViewModel(session: session, publicRoom: publicRoom) self.viewModel.coordinatorDelegate = self self.presentingViewController = viewController self.sourceView = sourceView diff --git a/Riot/Modules/Spaces/SpaceDetail/SpaceDetailViewController.swift b/Riot/Modules/Spaces/SpaceDetail/SpaceDetailViewController.swift index cfb11152c4..95f7e7b192 100644 --- a/Riot/Modules/Spaces/SpaceDetail/SpaceDetailViewController.swift +++ b/Riot/Modules/Spaces/SpaceDetail/SpaceDetailViewController.swift @@ -240,6 +240,8 @@ class SpaceDetailViewController: UIViewController { self.inviterAvatarView.fill(with: avatarViewData) } } + + view.layoutIfNeeded() } private func render(error: Error) { diff --git a/Riot/Modules/TabBar/TabBarCoordinator.swift b/Riot/Modules/TabBar/TabBarCoordinator.swift index c3d2462460..b0089693e8 100644 --- a/Riot/Modules/TabBar/TabBarCoordinator.swift +++ b/Riot/Modules/TabBar/TabBarCoordinator.swift @@ -53,6 +53,10 @@ final class TabBarCoordinator: NSObject, TabBarCoordinatorType { private var currentSpaceId: String? private var homeViewControllerWrapperViewController: HomeViewControllerWithBannerWrapperViewController? + private var currentMatrixSession: MXSession? { + return parameters.userSessionsService.mainUserSession?.matrixSession + } + // MARK: Public // Must be used only internally @@ -259,10 +263,8 @@ final class TabBarCoordinator: NSObject, TabBarCoordinatorType { private func updateMasterTabBarController(with spaceId: String?) { - let currentMatrixSession = self.parameters.userSessionsService.mainUserSession?.matrixSession - self.updateTabControllers(for: self.masterTabBarController, showCommunities: spaceId == nil) - self.masterTabBarController.filterRooms(withParentId: spaceId, inMatrixSession: currentMatrixSession) + self.masterTabBarController.filterRooms(withParentId: spaceId, inMatrixSession: self.currentMatrixSession) } private func updateTabControllers(for tabBarController: MasterTabBarController, showCommunities: Bool) { @@ -286,8 +288,7 @@ final class TabBarCoordinator: NSObject, TabBarCoordinatorType { viewControllers.append(roomsViewController) } - let matrixSession = parameters.userSessionsService.mainUserSession?.matrixSession - if RiotSettings.shared.homeScreenShowCommunitiesTab && !(matrixSession?.groups().isEmpty ?? false) && showCommunities { + if RiotSettings.shared.homeScreenShowCommunitiesTab && !(self.currentMatrixSession?.groups().isEmpty ?? false) && showCommunities { let groupsViewController = self.createGroupsViewController() viewControllers.append(groupsViewController) } @@ -350,7 +351,7 @@ final class TabBarCoordinator: NSObject, TabBarCoordinatorType { self.addMatrixSessionToMasterTabBarController(userSession.matrixSession) - if let matrixSession = parameters.userSessionsService.mainUserSession?.matrixSession, matrixSession.groups().isEmpty { + if let matrixSession = self.currentMatrixSession, matrixSession.groups().isEmpty { self.masterTabBarController.removeTab(at: .groups) } } @@ -380,7 +381,7 @@ final class TabBarCoordinator: NSObject, TabBarCoordinatorType { } @objc private func sessionDidSync(_ notification: Notification) { - if parameters.userSessionsService.mainUserSession?.matrixSession.groups().isEmpty ?? true { + if self.currentMatrixSession?.groups().isEmpty ?? true { self.masterTabBarController.removeTab(at: .groups) } }