mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Add polls' room summaries (#1770)
* Update sdk to 1.1.18 & add poll summary * Fix localisation
This commit is contained in:
@@ -5738,7 +5738,7 @@
|
|||||||
repositoryURL = "https://github.com/matrix-org/matrix-rust-components-swift";
|
repositoryURL = "https://github.com/matrix-org/matrix-rust-components-swift";
|
||||||
requirement = {
|
requirement = {
|
||||||
kind = exactVersion;
|
kind = exactVersion;
|
||||||
version = 1.1.17;
|
version = 1.1.18;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
821C67C9A7F8CC3FD41B28B4 /* XCRemoteSwiftPackageReference "emojibase-bindings" */ = {
|
821C67C9A7F8CC3FD41B28B4 /* XCRemoteSwiftPackageReference "emojibase-bindings" */ = {
|
||||||
|
|||||||
@@ -129,8 +129,8 @@
|
|||||||
"kind" : "remoteSourceControl",
|
"kind" : "remoteSourceControl",
|
||||||
"location" : "https://github.com/matrix-org/matrix-rust-components-swift",
|
"location" : "https://github.com/matrix-org/matrix-rust-components-swift",
|
||||||
"state" : {
|
"state" : {
|
||||||
"revision" : "5f7b353fc306e21237f71b9e242f7fc086ad00c8",
|
"revision" : "f00c834ec4f80c9eea43282b79b368c93ad6bd82",
|
||||||
"version" : "1.1.17"
|
"version" : "1.1.18"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
"a11y_show_password" = "Show password";
|
"a11y_show_password" = "Show password";
|
||||||
"a11y_user_menu" = "User menu";
|
"a11y_user_menu" = "User menu";
|
||||||
"action_accept" = "Accept";
|
"action_accept" = "Accept";
|
||||||
|
"action_add_to_timeline" = "Add to timeline";
|
||||||
"action_back" = "Back";
|
"action_back" = "Back";
|
||||||
"action_cancel" = "Cancel";
|
"action_cancel" = "Cancel";
|
||||||
"action_choose_photo" = "Choose photo";
|
"action_choose_photo" = "Choose photo";
|
||||||
@@ -144,6 +145,7 @@
|
|||||||
"common_verification_complete" = "Verification complete";
|
"common_verification_complete" = "Verification complete";
|
||||||
"common_video" = "Video";
|
"common_video" = "Video";
|
||||||
"common_waiting" = "Waiting…";
|
"common_waiting" = "Waiting…";
|
||||||
|
"common_poll_summary" = "Poll: %1$@";
|
||||||
"crash_detection_dialog_content" = "%1$@ crashed the last time it was used. Would you like to share a crash report with us?";
|
"crash_detection_dialog_content" = "%1$@ crashed the last time it was used. Would you like to share a crash report with us?";
|
||||||
"dialog_title_confirmation" = "Confirmation";
|
"dialog_title_confirmation" = "Confirmation";
|
||||||
"dialog_title_warning" = "Warning";
|
"dialog_title_warning" = "Warning";
|
||||||
@@ -331,7 +333,7 @@
|
|||||||
"screen_report_content_block_user_hint" = "Check if you want to hide all current and future messages from this user";
|
"screen_report_content_block_user_hint" = "Check if you want to hide all current and future messages from this user";
|
||||||
"screen_room_attachment_source_camera" = "Camera";
|
"screen_room_attachment_source_camera" = "Camera";
|
||||||
"screen_room_attachment_source_camera_photo" = "Take photo";
|
"screen_room_attachment_source_camera_photo" = "Take photo";
|
||||||
"screen_room_attachment_source_camera_video" = "Record a video";
|
"screen_room_attachment_source_camera_video" = "Record video";
|
||||||
"screen_room_attachment_source_files" = "Attachment";
|
"screen_room_attachment_source_files" = "Attachment";
|
||||||
"screen_room_attachment_source_gallery" = "Photo & Video Library";
|
"screen_room_attachment_source_gallery" = "Photo & Video Library";
|
||||||
"screen_room_attachment_source_location" = "Location";
|
"screen_room_attachment_source_location" = "Location";
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ public enum L10n {
|
|||||||
public static var a11yUserMenu: String { return L10n.tr("Localizable", "a11y_user_menu") }
|
public static var a11yUserMenu: String { return L10n.tr("Localizable", "a11y_user_menu") }
|
||||||
/// Accept
|
/// Accept
|
||||||
public static var actionAccept: String { return L10n.tr("Localizable", "action_accept") }
|
public static var actionAccept: String { return L10n.tr("Localizable", "action_accept") }
|
||||||
|
/// Add to timeline
|
||||||
|
public static var actionAddToTimeline: String { return L10n.tr("Localizable", "action_add_to_timeline") }
|
||||||
/// Back
|
/// Back
|
||||||
public static var actionBack: String { return L10n.tr("Localizable", "action_back") }
|
public static var actionBack: String { return L10n.tr("Localizable", "action_back") }
|
||||||
/// Cancel
|
/// Cancel
|
||||||
@@ -230,6 +232,10 @@ public enum L10n {
|
|||||||
public static var commonPeople: String { return L10n.tr("Localizable", "common_people") }
|
public static var commonPeople: String { return L10n.tr("Localizable", "common_people") }
|
||||||
/// Permalink
|
/// Permalink
|
||||||
public static var commonPermalink: String { return L10n.tr("Localizable", "common_permalink") }
|
public static var commonPermalink: String { return L10n.tr("Localizable", "common_permalink") }
|
||||||
|
/// Poll: %1$@
|
||||||
|
public static func commonPollSummary(_ p1: Any) -> String {
|
||||||
|
return L10n.tr("Localizable", "common_poll_summary", String(describing: p1))
|
||||||
|
}
|
||||||
/// Total votes: %1$@
|
/// Total votes: %1$@
|
||||||
public static func commonPollTotalVotes(_ p1: Any) -> String {
|
public static func commonPollTotalVotes(_ p1: Any) -> String {
|
||||||
return L10n.tr("Localizable", "common_poll_total_votes", String(describing: p1))
|
return L10n.tr("Localizable", "common_poll_total_votes", String(describing: p1))
|
||||||
@@ -830,7 +836,7 @@ public enum L10n {
|
|||||||
public static var screenRoomAttachmentSourceCamera: String { return L10n.tr("Localizable", "screen_room_attachment_source_camera") }
|
public static var screenRoomAttachmentSourceCamera: String { return L10n.tr("Localizable", "screen_room_attachment_source_camera") }
|
||||||
/// Take photo
|
/// Take photo
|
||||||
public static var screenRoomAttachmentSourceCameraPhoto: String { return L10n.tr("Localizable", "screen_room_attachment_source_camera_photo") }
|
public static var screenRoomAttachmentSourceCameraPhoto: String { return L10n.tr("Localizable", "screen_room_attachment_source_camera_photo") }
|
||||||
/// Record a video
|
/// Record video
|
||||||
public static var screenRoomAttachmentSourceCameraVideo: String { return L10n.tr("Localizable", "screen_room_attachment_source_camera_video") }
|
public static var screenRoomAttachmentSourceCameraVideo: String { return L10n.tr("Localizable", "screen_room_attachment_source_camera_video") }
|
||||||
/// Attachment
|
/// Attachment
|
||||||
public static var screenRoomAttachmentSourceFiles: String { return L10n.tr("Localizable", "screen_room_attachment_source_files") }
|
public static var screenRoomAttachmentSourceFiles: String { return L10n.tr("Localizable", "screen_room_attachment_source_files") }
|
||||||
|
|||||||
@@ -1370,11 +1370,11 @@ class RoomProxyMock: RoomProxyProtocol {
|
|||||||
return setNameCallsCount > 0
|
return setNameCallsCount > 0
|
||||||
}
|
}
|
||||||
var setNameReceivedName: String?
|
var setNameReceivedName: String?
|
||||||
var setNameReceivedInvocations: [String?] = []
|
var setNameReceivedInvocations: [String] = []
|
||||||
var setNameReturnValue: Result<Void, RoomProxyError>!
|
var setNameReturnValue: Result<Void, RoomProxyError>!
|
||||||
var setNameClosure: ((String?) async -> Result<Void, RoomProxyError>)?
|
var setNameClosure: ((String) async -> Result<Void, RoomProxyError>)?
|
||||||
|
|
||||||
func setName(_ name: String?) async -> Result<Void, RoomProxyError> {
|
func setName(_ name: String) async -> Result<Void, RoomProxyError> {
|
||||||
setNameCallsCount += 1
|
setNameCallsCount += 1
|
||||||
setNameReceivedName = name
|
setNameReceivedName = name
|
||||||
setNameReceivedInvocations.append(name)
|
setNameReceivedInvocations.append(name)
|
||||||
|
|||||||
@@ -633,7 +633,7 @@ class RoomProxy: RoomProxyProtocol {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func setName(_ name: String?) async -> Result<Void, RoomProxyError> {
|
func setName(_ name: String) async -> Result<Void, RoomProxyError> {
|
||||||
await Task.dispatch(on: .global()) {
|
await Task.dispatch(on: .global()) {
|
||||||
do {
|
do {
|
||||||
return try .success(self.room.setName(name: name))
|
return try .success(self.room.setName(name: name))
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ protocol RoomProxyProtocol {
|
|||||||
|
|
||||||
func invite(userID: String) async -> Result<Void, RoomProxyError>
|
func invite(userID: String) async -> Result<Void, RoomProxyError>
|
||||||
|
|
||||||
func setName(_ name: String?) async -> Result<Void, RoomProxyError>
|
func setName(_ name: String) async -> Result<Void, RoomProxyError>
|
||||||
|
|
||||||
func setTopic(_ topic: String) async -> Result<Void, RoomProxyError>
|
func setTopic(_ topic: String) async -> Result<Void, RoomProxyError>
|
||||||
|
|
||||||
|
|||||||
@@ -68,9 +68,8 @@ struct RoomEventStringBuilder {
|
|||||||
member: sender.id,
|
member: sender.id,
|
||||||
memberIsYou: isOutgoing)
|
memberIsYou: isOutgoing)
|
||||||
.map(AttributedString.init)
|
.map(AttributedString.init)
|
||||||
case .poll:
|
case .poll(let question, _, _, _, _, _):
|
||||||
// The Rust SDK doesn't support poll events as room summaries yet
|
return prefix(L10n.commonPollSummary(question), with: senderDisplayName)
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -45,7 +45,7 @@ packages:
|
|||||||
# Element/Matrix dependencies
|
# Element/Matrix dependencies
|
||||||
MatrixRustSDK:
|
MatrixRustSDK:
|
||||||
url: https://github.com/matrix-org/matrix-rust-components-swift
|
url: https://github.com/matrix-org/matrix-rust-components-swift
|
||||||
exactVersion: 1.1.17
|
exactVersion: 1.1.18
|
||||||
# path: ../matrix-rust-sdk
|
# path: ../matrix-rust-sdk
|
||||||
DesignKit:
|
DesignKit:
|
||||||
path: DesignKit
|
path: DesignKit
|
||||||
|
|||||||
Reference in New Issue
Block a user