Skip to content

Commit 87e3c64

Browse files
authored
Wrong copy for upgrade room message (#6003)
* Wrong copy for upgrade room message - fixed
1 parent a30f90f commit 87e3c64

22 files changed

+133
-64
lines changed

Riot/Assets/en.lproj/Vector.strings

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,9 @@ Tap the + to start adding people.";
926926
"room_access_settings_screen_public_message" = "Anyone can find and join.";
927927

928928
"room_access_settings_screen_upgrade_alert_title" = "Upgrade room";
929-
"room_access_settings_screen_upgrade_alert_message" = "Anyone in Space name will be able to find and join this room - no need to manually invite everyone. You’ll be able to change this in room settings anytime.\n\nPlease note upgrading will make a new version of the room. All current messages will stay in this archived room.";
929+
"room_access_settings_screen_upgrade_alert_message" = "Anyone in %@ will be able to find and join this room - no need to manually invite everyone. You’ll be able to change this in room settings anytime.";
930+
"room_access_settings_screen_upgrade_alert_message_no_param" = "Anyone in a parent space will be able to find and join this room - no need to manually invite everyone. You’ll be able to change this in room settings anytime.";
931+
"room_access_settings_screen_upgrade_alert_note" = "Please note upgrading will make a new version of the room. All current messages will stay in this archived room.";
930932
"room_access_settings_screen_upgrade_alert_auto_invite_switch" = "Automatically invite members to new room";
931933
"room_access_settings_screen_upgrade_alert_upgrade_button" = "Upgrade";
932934
"room_access_settings_screen_upgrade_alert_upgrading" = "Upgrading room";

Riot/Generated/Strings.swift

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4279,9 +4279,17 @@ public class VectorL10n: NSObject {
42794279
public static var roomAccessSettingsScreenUpgradeAlertAutoInviteSwitch: String {
42804280
return VectorL10n.tr("Vector", "room_access_settings_screen_upgrade_alert_auto_invite_switch")
42814281
}
4282-
/// Anyone in Space name will be able to find and join this room - no need to manually invite everyone. You’ll be able to change this in room settings anytime.\n\nPlease note upgrading will make a new version of the room. All current messages will stay in this archived room.
4283-
public static var roomAccessSettingsScreenUpgradeAlertMessage: String {
4284-
return VectorL10n.tr("Vector", "room_access_settings_screen_upgrade_alert_message")
4282+
/// Anyone in %@ will be able to find and join this room - no need to manually invite everyone. You’ll be able to change this in room settings anytime.
4283+
public static func roomAccessSettingsScreenUpgradeAlertMessage(_ p1: String) -> String {
4284+
return VectorL10n.tr("Vector", "room_access_settings_screen_upgrade_alert_message", p1)
4285+
}
4286+
/// Anyone in a parent space will be able to find and join this room - no need to manually invite everyone. You’ll be able to change this in room settings anytime.
4287+
public static var roomAccessSettingsScreenUpgradeAlertMessageNoParam: String {
4288+
return VectorL10n.tr("Vector", "room_access_settings_screen_upgrade_alert_message_no_param")
4289+
}
4290+
/// Please note upgrading will make a new version of the room. All current messages will stay in this archived room.
4291+
public static var roomAccessSettingsScreenUpgradeAlertNote: String {
4292+
return VectorL10n.tr("Vector", "room_access_settings_screen_upgrade_alert_note")
42854293
}
42864294
/// Upgrade room
42874295
public static var roomAccessSettingsScreenUpgradeAlertTitle: String {

Riot/Modules/Room/RoomInfo/RoomInfoCoordinator.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ final class RoomInfoCoordinator: NSObject, RoomInfoCoordinatorType {
5656
}
5757

5858
let settings = RoomSettingsViewController()
59+
settings.parentSpaceId = parentSpaceId
5960
settings.delegate = self
6061
settings.finalizeInit()
6162
settings.screenTracker = AnalyticsScreenTracker(screen: .roomSettings)

Riot/Modules/Room/Settings/RoomSettingsViewController.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ typedef enum : NSUInteger {
6060
*/
6161
@property (nonatomic) AnalyticsScreenTracker *screenTracker;
6262

63+
/**
64+
ID of the currently selected space. `nil` if home
65+
*/
66+
@property (nonatomic, nullable) NSString *parentSpaceId;
67+
6368
/**
6469
Delegate of this view controller.
6570
*/

Riot/Modules/Room/Settings/RoomSettingsViewController.m

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3832,23 +3832,29 @@ - (void)toggleDirectoryVisibility:(UISwitch*)theSwitch
38323832

38333833
- (void)showRoomAccessFlow
38343834
{
3835-
MXRoom *room = [self.mainSession roomWithRoomId:self.roomId];
3836-
3837-
if (room) {
3838-
roomAccessPresenter = [[RoomAccessCoordinatorBridgePresenter alloc] initWithRoom:room];
3839-
roomAccessPresenter.delegate = self;
3840-
[roomAccessPresenter presentFrom:self animated:YES];
3835+
if (@available(iOS 14.0, *))
3836+
{
3837+
MXRoom *room = [self.mainSession roomWithRoomId:self.roomId];
3838+
3839+
if (room) {
3840+
roomAccessPresenter = [[RoomAccessCoordinatorBridgePresenter alloc] initWithRoom:room parentSpaceId:self.parentSpaceId];
3841+
roomAccessPresenter.delegate = self;
3842+
[roomAccessPresenter presentFrom:self animated:YES];
3843+
}
38413844
}
38423845
}
38433846

38443847
- (void)showSuggestToSpaceMembers
38453848
{
3846-
MXRoom *room = [self.mainSession roomWithRoomId:self.roomId];
3847-
3848-
if (room) {
3849-
roomSuggestionPresenter = [[RoomSuggestionCoordinatorBridgePresenter alloc] initWithRoom:room];
3850-
roomSuggestionPresenter.delegate = self;
3851-
[roomSuggestionPresenter presentFrom:self animated:YES];
3849+
if (@available(iOS 14.0, *))
3850+
{
3851+
MXRoom *room = [self.mainSession roomWithRoomId:self.roomId];
3852+
3853+
if (room) {
3854+
roomSuggestionPresenter = [[RoomSuggestionCoordinatorBridgePresenter alloc] initWithRoom:room];
3855+
roomSuggestionPresenter.delegate = self;
3856+
[roomSuggestionPresenter presentFrom:self animated:YES];
3857+
}
38523858
}
38533859
}
38543860

Riot/Modules/SideMenu/SideMenuCoordinator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ final class SideMenuCoordinator: NSObject, SideMenuCoordinatorType {
303303

304304
@available(iOS 14.0, *)
305305
private func showSpaceSettings(spaceId: String, session: MXSession) {
306-
let coordinator = SpaceSettingsModalCoordinator(parameters: SpaceSettingsModalCoordinatorParameters(session: session, spaceId: spaceId))
306+
let coordinator = SpaceSettingsModalCoordinator(parameters: SpaceSettingsModalCoordinatorParameters(session: session, spaceId: spaceId, parentSpaceId: nil))
307307
coordinator.callback = { [weak self] result in
308308
guard let self = self else { return }
309309

Riot/Modules/Spaces/SpaceRoomList/ExploreRoomCoordinator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ final class ExploreRoomCoordinator: NSObject, ExploreRoomCoordinatorType {
206206

207207
@available(iOS 14.0, *)
208208
private func showSpaceSettings(of childInfo: MXSpaceChildInfo) {
209-
let coordinator = SpaceSettingsModalCoordinator(parameters: SpaceSettingsModalCoordinatorParameters(session: session, spaceId: childInfo.childRoomId))
209+
let coordinator = SpaceSettingsModalCoordinator(parameters: SpaceSettingsModalCoordinatorParameters(session: session, spaceId: childInfo.childRoomId, parentSpaceId: spaceIdStack.last))
210210
coordinator.callback = { [weak self] result in
211211
guard let self = self else { return }
212212

RiotSwiftUI/Modules/Room/RoomAccess/Coordinator/RoomAccessCoordinator.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ final class RoomAccessCoordinator: Coordinator {
154154
let paramaters = RoomUpgradeCoordinatorParameters(
155155
session: parameters.room.mxSession,
156156
roomId: roomId,
157+
parentSpaceId: parameters.parentSpaceId,
157158
versionOverride: versionOverride)
158159
let coordinator = RoomUpgradeCoordinator(parameters: paramaters)
159160

RiotSwiftUI/Modules/Room/RoomAccess/Coordinator/RoomAccessCoordinatorBridgePresenter.swift

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
// limitations under the License.
1515
//
1616
import UIKit
17+
import MatrixSDK
1718

1819
@available(iOS 14.0, *)
1920
@objc protocol RoomAccessCoordinatorBridgePresenterDelegate {
@@ -34,6 +35,7 @@ final class RoomAccessCoordinatorBridgePresenter: NSObject {
3435
// MARK: Private
3536

3637
private let room: MXRoom
38+
private let parentSpaceId: String?
3739
private let allowsRoomUpgrade: Bool
3840
private var coordinator: RoomAccessCoordinator?
3941

@@ -44,21 +46,24 @@ final class RoomAccessCoordinatorBridgePresenter: NSObject {
4446
// MARK: - Setup
4547

4648
init(room: MXRoom,
49+
parentSpaceId: String?,
4750
allowsRoomUpgrade: Bool) {
4851
self.room = room
52+
self.parentSpaceId = parentSpaceId
4953
self.allowsRoomUpgrade = allowsRoomUpgrade
5054
super.init()
5155
}
5256

53-
convenience init(room: MXRoom) {
54-
self.init(room: room, allowsRoomUpgrade: true)
57+
convenience init(room: MXRoom,
58+
parentSpaceId: String?) {
59+
self.init(room: room, parentSpaceId: parentSpaceId, allowsRoomUpgrade: true)
5560
}
5661

5762
// MARK: - Public
5863

5964
func present(from viewController: UIViewController, animated: Bool) {
6065
let navigationRouter = NavigationRouter()
61-
let coordinator = RoomAccessCoordinator(parameters: RoomAccessCoordinatorParameters(room: room, allowsRoomUpgrade: allowsRoomUpgrade, navigationRouter: navigationRouter))
66+
let coordinator = RoomAccessCoordinator(parameters: RoomAccessCoordinatorParameters(room: room, parentSpaceId: parentSpaceId, allowsRoomUpgrade: allowsRoomUpgrade, navigationRouter: navigationRouter))
6267
coordinator.callback = { [weak self] result in
6368
guard let self = self else { return }
6469

RiotSwiftUI/Modules/Room/RoomAccess/Coordinator/RoomAccessCoordinatorParameters.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,21 @@ struct RoomAccessCoordinatorParameters {
2424
/// The Matrix room
2525
let room: MXRoom
2626

27+
/// ID of the currently selected space. `nil` if home space
28+
let parentSpaceId: String?
29+
2730
/// Set this value to false if you want to avoid room to be upgraded
2831
let allowsRoomUpgrade: Bool
2932

3033
/// The navigation router that manage physical navigation
3134
let navigationRouter: NavigationRouterType
3235

3336
init(room: MXRoom,
37+
parentSpaceId: String?,
3438
allowsRoomUpgrade: Bool = true,
3539
navigationRouter: NavigationRouterType? = nil) {
3640
self.room = room
41+
self.parentSpaceId = parentSpaceId
3742
self.allowsRoomUpgrade = allowsRoomUpgrade
3843
self.navigationRouter = navigationRouter ?? NavigationRouter(navigationController: RiotNavigationController())
3944
}

0 commit comments

Comments
 (0)