mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Change Leave Room to Leave Conversation for DMs (#2354)
This commit is contained in:
@@ -56,6 +56,7 @@
|
|||||||
"action_join" = "Join";
|
"action_join" = "Join";
|
||||||
"action_learn_more" = "Learn more";
|
"action_learn_more" = "Learn more";
|
||||||
"action_leave" = "Leave";
|
"action_leave" = "Leave";
|
||||||
|
"action_leave_conversation" = "Leave conversation";
|
||||||
"action_leave_room" = "Leave room";
|
"action_leave_room" = "Leave room";
|
||||||
"action_manage_account" = "Manage account";
|
"action_manage_account" = "Manage account";
|
||||||
"action_manage_devices" = "Manage devices";
|
"action_manage_devices" = "Manage devices";
|
||||||
@@ -228,6 +229,7 @@
|
|||||||
"error_unknown" = "Sorry, an error occurred";
|
"error_unknown" = "Sorry, an error occurred";
|
||||||
"invite_friends_rich_title" = "🔐️ Join me on %1$@";
|
"invite_friends_rich_title" = "🔐️ Join me on %1$@";
|
||||||
"invite_friends_text" = "Hey, talk to me on %1$@: %2$@";
|
"invite_friends_text" = "Hey, talk to me on %1$@: %2$@";
|
||||||
|
"leave_conversation_alert_subtitle" = "Are you sure that you want to leave this conversation? This conversation is not public and you won't be able to rejoin without an invite.";
|
||||||
"leave_room_alert_empty_subtitle" = "Are you sure that you want to leave this room? You're the only person here. If you leave, no one will be able to join in the future, including you.";
|
"leave_room_alert_empty_subtitle" = "Are you sure that you want to leave this room? You're the only person here. If you leave, no one will be able to join in the future, including you.";
|
||||||
"leave_room_alert_private_subtitle" = "Are you sure that you want to leave this room? This room is not public and you won't be able to rejoin without an invite.";
|
"leave_room_alert_private_subtitle" = "Are you sure that you want to leave this room? This room is not public and you won't be able to rejoin without an invite.";
|
||||||
"leave_room_alert_subtitle" = "Are you sure that you want to leave the room?";
|
"leave_room_alert_subtitle" = "Are you sure that you want to leave the room?";
|
||||||
@@ -679,6 +681,7 @@
|
|||||||
"screen_dm_details_unblock_user" = "Unblock user";
|
"screen_dm_details_unblock_user" = "Unblock user";
|
||||||
"screen_login_subtitle" = "Matrix is an open network for secure, decentralised communication.";
|
"screen_login_subtitle" = "Matrix is an open network for secure, decentralised communication.";
|
||||||
"screen_report_content_block_user" = "Block user";
|
"screen_report_content_block_user" = "Block user";
|
||||||
|
"screen_room_details_leave_conversation_title" = "Leave conversation";
|
||||||
"screen_room_details_leave_room_title" = "Leave room";
|
"screen_room_details_leave_room_title" = "Leave room";
|
||||||
"screen_room_details_security_title" = "Security";
|
"screen_room_details_security_title" = "Security";
|
||||||
"screen_room_details_topic_title" = "Topic";
|
"screen_room_details_topic_title" = "Topic";
|
||||||
|
|||||||
@@ -146,6 +146,8 @@ public enum L10n {
|
|||||||
public static var actionLearnMore: String { return L10n.tr("Localizable", "action_learn_more") }
|
public static var actionLearnMore: String { return L10n.tr("Localizable", "action_learn_more") }
|
||||||
/// Leave
|
/// Leave
|
||||||
public static var actionLeave: String { return L10n.tr("Localizable", "action_leave") }
|
public static var actionLeave: String { return L10n.tr("Localizable", "action_leave") }
|
||||||
|
/// Leave conversation
|
||||||
|
public static var actionLeaveConversation: String { return L10n.tr("Localizable", "action_leave_conversation") }
|
||||||
/// Leave room
|
/// Leave room
|
||||||
public static var actionLeaveRoom: String { return L10n.tr("Localizable", "action_leave_room") }
|
public static var actionLeaveRoom: String { return L10n.tr("Localizable", "action_leave_room") }
|
||||||
/// Manage account
|
/// Manage account
|
||||||
@@ -524,6 +526,8 @@ public enum L10n {
|
|||||||
public static func inviteFriendsText(_ p1: Any, _ p2: Any) -> String {
|
public static func inviteFriendsText(_ p1: Any, _ p2: Any) -> String {
|
||||||
return L10n.tr("Localizable", "invite_friends_text", String(describing: p1), String(describing: p2))
|
return L10n.tr("Localizable", "invite_friends_text", String(describing: p1), String(describing: p2))
|
||||||
}
|
}
|
||||||
|
/// Are you sure that you want to leave this conversation? This conversation is not public and you won't be able to rejoin without an invite.
|
||||||
|
public static var leaveConversationAlertSubtitle: String { return L10n.tr("Localizable", "leave_conversation_alert_subtitle") }
|
||||||
/// Are you sure that you want to leave this room? You're the only person here. If you leave, no one will be able to join in the future, including you.
|
/// Are you sure that you want to leave this room? You're the only person here. If you leave, no one will be able to join in the future, including you.
|
||||||
public static var leaveRoomAlertEmptySubtitle: String { return L10n.tr("Localizable", "leave_room_alert_empty_subtitle") }
|
public static var leaveRoomAlertEmptySubtitle: String { return L10n.tr("Localizable", "leave_room_alert_empty_subtitle") }
|
||||||
/// Are you sure that you want to leave this room? This room is not public and you won't be able to rejoin without an invite.
|
/// Are you sure that you want to leave this room? This room is not public and you won't be able to rejoin without an invite.
|
||||||
@@ -1188,6 +1192,8 @@ public enum L10n {
|
|||||||
public static var screenRoomDetailsErrorUnmuting: String { return L10n.tr("Localizable", "screen_room_details_error_unmuting") }
|
public static var screenRoomDetailsErrorUnmuting: String { return L10n.tr("Localizable", "screen_room_details_error_unmuting") }
|
||||||
/// Invite people
|
/// Invite people
|
||||||
public static var screenRoomDetailsInvitePeopleTitle: String { return L10n.tr("Localizable", "screen_room_details_invite_people_title") }
|
public static var screenRoomDetailsInvitePeopleTitle: String { return L10n.tr("Localizable", "screen_room_details_invite_people_title") }
|
||||||
|
/// Leave conversation
|
||||||
|
public static var screenRoomDetailsLeaveConversationTitle: String { return L10n.tr("Localizable", "screen_room_details_leave_conversation_title") }
|
||||||
/// Leave room
|
/// Leave room
|
||||||
public static var screenRoomDetailsLeaveRoomTitle: String { return L10n.tr("Localizable", "screen_room_details_leave_room_title") }
|
public static var screenRoomDetailsLeaveRoomTitle: String { return L10n.tr("Localizable", "screen_room_details_leave_room_title") }
|
||||||
/// Custom
|
/// Custom
|
||||||
|
|||||||
@@ -331,9 +331,9 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
|
|||||||
}
|
}
|
||||||
|
|
||||||
if room.isPublic {
|
if room.isPublic {
|
||||||
state.bindings.leaveRoomAlertItem = LeaveRoomAlertItem(roomId: roomId, state: .public)
|
state.bindings.leaveRoomAlertItem = LeaveRoomAlertItem(roomId: roomId, isDM: room.isEncryptedOneToOneRoom, state: .public)
|
||||||
} else {
|
} else {
|
||||||
state.bindings.leaveRoomAlertItem = room.joinedMembersCount > 1 ? LeaveRoomAlertItem(roomId: roomId, state: .private) : LeaveRoomAlertItem(roomId: roomId, state: .empty)
|
state.bindings.leaveRoomAlertItem = room.joinedMembersCount > 1 ? LeaveRoomAlertItem(roomId: roomId, isDM: room.isEncryptedOneToOneRoom, state: .private) : LeaveRoomAlertItem(roomId: roomId, isDM: room.isEncryptedOneToOneRoom, state: .empty)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -147,15 +147,19 @@ struct LeaveRoomAlertItem: AlertProtocol {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let roomId: String
|
let roomId: String
|
||||||
|
let isDM: Bool
|
||||||
let state: RoomState
|
let state: RoomState
|
||||||
let title = L10n.actionLeaveRoom
|
|
||||||
let confirmationTitle = L10n.actionLeave
|
let confirmationTitle = L10n.actionLeave
|
||||||
let cancelTitle = L10n.actionCancel
|
let cancelTitle = L10n.actionCancel
|
||||||
|
|
||||||
|
var title: String {
|
||||||
|
isDM ? L10n.actionLeaveConversation : L10n.actionLeaveRoom
|
||||||
|
}
|
||||||
|
|
||||||
var subtitle: String {
|
var subtitle: String {
|
||||||
switch state {
|
switch state {
|
||||||
case .empty: return L10n.leaveRoomAlertEmptySubtitle
|
case .empty: return L10n.leaveRoomAlertEmptySubtitle
|
||||||
case .private: return L10n.leaveRoomAlertPrivateSubtitle
|
case .private: return isDM ? L10n.leaveConversationAlertSubtitle : L10n.leaveRoomAlertPrivateSubtitle
|
||||||
case .public: return L10n.leaveRoomAlertSubtitle
|
case .public: return L10n.leaveRoomAlertSubtitle
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,10 +90,10 @@ class RoomDetailsScreenViewModel: RoomDetailsScreenViewModelType, RoomDetailsScr
|
|||||||
actionsSubject.send(.requestInvitePeoplePresentation)
|
actionsSubject.send(.requestInvitePeoplePresentation)
|
||||||
case .processTapLeave:
|
case .processTapLeave:
|
||||||
guard state.joinedMembersCount > 1 else {
|
guard state.joinedMembersCount > 1 else {
|
||||||
state.bindings.leaveRoomAlertItem = LeaveRoomAlertItem(roomId: roomProxy.id, state: .empty)
|
state.bindings.leaveRoomAlertItem = LeaveRoomAlertItem(roomId: roomProxy.id, isDM: roomProxy.isEncryptedOneToOneRoom, state: .empty)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
state.bindings.leaveRoomAlertItem = LeaveRoomAlertItem(roomId: roomProxy.id, state: roomProxy.isPublic ? .public : .private)
|
state.bindings.leaveRoomAlertItem = LeaveRoomAlertItem(roomId: roomProxy.id, isDM: roomProxy.isEncryptedOneToOneRoom, state: roomProxy.isPublic ? .public : .private)
|
||||||
case .confirmLeave:
|
case .confirmLeave:
|
||||||
Task { await leaveRoom() }
|
Task { await leaveRoom() }
|
||||||
case .processTapIgnore:
|
case .processTapIgnore:
|
||||||
|
|||||||
@@ -220,10 +220,14 @@ struct RoomDetailsScreen: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private var leaveRoomTitle: String {
|
||||||
|
context.viewState.dmRecipient == nil ? L10n.screenRoomDetailsLeaveRoomTitle : L10n.screenRoomDetailsLeaveConversationTitle
|
||||||
|
}
|
||||||
|
|
||||||
private var leaveRoomSection: some View {
|
private var leaveRoomSection: some View {
|
||||||
Section {
|
Section {
|
||||||
ListRow(label: .action(title: L10n.actionLeaveRoom,
|
ListRow(label: .action(title: leaveRoomTitle,
|
||||||
icon: \.leave,
|
icon: \.leave,
|
||||||
role: .destructive),
|
role: .destructive),
|
||||||
kind: .button { context.send(viewAction: .processTapLeave) })
|
kind: .button { context.send(viewAction: .processTapLeave) })
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
Change Leave Room to Leave Conversation for DMs
|
||||||
Reference in New Issue
Block a user