mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
Add polls' room summaries (#1770)
* Update sdk to 1.1.18 & add poll summary * Fix localisation
This commit is contained in:
@@ -28,6 +28,8 @@ public enum L10n {
|
||||
public static var a11yUserMenu: String { return L10n.tr("Localizable", "a11y_user_menu") }
|
||||
/// 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
|
||||
public static var actionBack: String { return L10n.tr("Localizable", "action_back") }
|
||||
/// Cancel
|
||||
@@ -230,6 +232,10 @@ public enum L10n {
|
||||
public static var commonPeople: String { return L10n.tr("Localizable", "common_people") }
|
||||
/// 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$@
|
||||
public static func commonPollTotalVotes(_ p1: Any) -> String {
|
||||
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") }
|
||||
/// Take 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") }
|
||||
/// Attachment
|
||||
public static var screenRoomAttachmentSourceFiles: String { return L10n.tr("Localizable", "screen_room_attachment_source_files") }
|
||||
|
||||
@@ -1370,11 +1370,11 @@ class RoomProxyMock: RoomProxyProtocol {
|
||||
return setNameCallsCount > 0
|
||||
}
|
||||
var setNameReceivedName: String?
|
||||
var setNameReceivedInvocations: [String?] = []
|
||||
var setNameReceivedInvocations: [String] = []
|
||||
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
|
||||
setNameReceivedName = 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()) {
|
||||
do {
|
||||
return try .success(self.room.setName(name: name))
|
||||
|
||||
@@ -159,7 +159,7 @@ protocol RoomProxyProtocol {
|
||||
|
||||
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>
|
||||
|
||||
|
||||
@@ -68,9 +68,8 @@ struct RoomEventStringBuilder {
|
||||
member: sender.id,
|
||||
memberIsYou: isOutgoing)
|
||||
.map(AttributedString.init)
|
||||
case .poll:
|
||||
// The Rust SDK doesn't support poll events as room summaries yet
|
||||
return nil
|
||||
case .poll(let question, _, _, _, _, _):
|
||||
return prefix(L10n.commonPollSummary(question), with: senderDisplayName)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user