mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Remove redundant remove failed sent message menu
This commit is contained in:
@@ -4,82 +4,6 @@
|
|||||||
// swiftlint:disable all
|
// swiftlint:disable all
|
||||||
import Foundation
|
import Foundation
|
||||||
import MatrixRustSDK
|
import MatrixRustSDK
|
||||||
open class AbortSendHandleSDKMock: MatrixRustSDK.AbortSendHandle {
|
|
||||||
init() {
|
|
||||||
super.init(noPointer: .init())
|
|
||||||
}
|
|
||||||
|
|
||||||
public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) {
|
|
||||||
fatalError("init(unsafeFromRawPointer:) has not been implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
fileprivate var pointer: UnsafeMutableRawPointer!
|
|
||||||
|
|
||||||
//MARK: - abort
|
|
||||||
|
|
||||||
var abortUnderlyingCallsCount = 0
|
|
||||||
open var abortCallsCount: Int {
|
|
||||||
get {
|
|
||||||
if Thread.isMainThread {
|
|
||||||
return abortUnderlyingCallsCount
|
|
||||||
} else {
|
|
||||||
var returnValue: Int? = nil
|
|
||||||
DispatchQueue.main.sync {
|
|
||||||
returnValue = abortUnderlyingCallsCount
|
|
||||||
}
|
|
||||||
|
|
||||||
return returnValue!
|
|
||||||
}
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
if Thread.isMainThread {
|
|
||||||
abortUnderlyingCallsCount = newValue
|
|
||||||
} else {
|
|
||||||
DispatchQueue.main.sync {
|
|
||||||
abortUnderlyingCallsCount = newValue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
open var abortCalled: Bool {
|
|
||||||
return abortCallsCount > 0
|
|
||||||
}
|
|
||||||
|
|
||||||
var abortUnderlyingReturnValue: Bool!
|
|
||||||
open var abortReturnValue: Bool! {
|
|
||||||
get {
|
|
||||||
if Thread.isMainThread {
|
|
||||||
return abortUnderlyingReturnValue
|
|
||||||
} else {
|
|
||||||
var returnValue: Bool? = nil
|
|
||||||
DispatchQueue.main.sync {
|
|
||||||
returnValue = abortUnderlyingReturnValue
|
|
||||||
}
|
|
||||||
|
|
||||||
return returnValue!
|
|
||||||
}
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
if Thread.isMainThread {
|
|
||||||
abortUnderlyingReturnValue = newValue
|
|
||||||
} else {
|
|
||||||
DispatchQueue.main.sync {
|
|
||||||
abortUnderlyingReturnValue = newValue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
open var abortClosure: (() async -> Bool)?
|
|
||||||
|
|
||||||
open override func abort() async -> Bool {
|
|
||||||
abortCallsCount += 1
|
|
||||||
if let abortClosure = abortClosure {
|
|
||||||
return await abortClosure()
|
|
||||||
} else {
|
|
||||||
return abortReturnValue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
open class ClientSDKMock: MatrixRustSDK.Client {
|
open class ClientSDKMock: MatrixRustSDK.Client {
|
||||||
init() {
|
init() {
|
||||||
super.init(noPointer: .init())
|
super.init(noPointer: .init())
|
||||||
@@ -711,15 +635,15 @@ open class ClientSDKMock: MatrixRustSDK.Client {
|
|||||||
}
|
}
|
||||||
open var enableAllSendQueuesEnableReceivedEnable: Bool?
|
open var enableAllSendQueuesEnableReceivedEnable: Bool?
|
||||||
open var enableAllSendQueuesEnableReceivedInvocations: [Bool] = []
|
open var enableAllSendQueuesEnableReceivedInvocations: [Bool] = []
|
||||||
open var enableAllSendQueuesEnableClosure: ((Bool) -> Void)?
|
open var enableAllSendQueuesEnableClosure: ((Bool) async -> Void)?
|
||||||
|
|
||||||
open override func enableAllSendQueues(enable: Bool) {
|
open override func enableAllSendQueues(enable: Bool) async {
|
||||||
enableAllSendQueuesEnableCallsCount += 1
|
enableAllSendQueuesEnableCallsCount += 1
|
||||||
enableAllSendQueuesEnableReceivedEnable = enable
|
enableAllSendQueuesEnableReceivedEnable = enable
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
self.enableAllSendQueuesEnableReceivedInvocations.append(enable)
|
self.enableAllSendQueuesEnableReceivedInvocations.append(enable)
|
||||||
}
|
}
|
||||||
enableAllSendQueuesEnableClosure?(enable)
|
await enableAllSendQueuesEnableClosure?(enable)
|
||||||
}
|
}
|
||||||
|
|
||||||
//MARK: - encryption
|
//MARK: - encryption
|
||||||
@@ -9246,6 +9170,82 @@ open class NotificationSettingsSDKMock: MatrixRustSDK.NotificationSettings {
|
|||||||
try await unmuteRoomRoomIdIsEncryptedIsOneToOneClosure?(roomId, isEncrypted, isOneToOne)
|
try await unmuteRoomRoomIdIsEncryptedIsOneToOneClosure?(roomId, isEncrypted, isOneToOne)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
open class OidcAuthorizationDataSDKMock: MatrixRustSDK.OidcAuthorizationData {
|
||||||
|
init() {
|
||||||
|
super.init(noPointer: .init())
|
||||||
|
}
|
||||||
|
|
||||||
|
public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) {
|
||||||
|
fatalError("init(unsafeFromRawPointer:) has not been implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
fileprivate var pointer: UnsafeMutableRawPointer!
|
||||||
|
|
||||||
|
//MARK: - loginUrl
|
||||||
|
|
||||||
|
var loginUrlUnderlyingCallsCount = 0
|
||||||
|
open var loginUrlCallsCount: Int {
|
||||||
|
get {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
return loginUrlUnderlyingCallsCount
|
||||||
|
} else {
|
||||||
|
var returnValue: Int? = nil
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
returnValue = loginUrlUnderlyingCallsCount
|
||||||
|
}
|
||||||
|
|
||||||
|
return returnValue!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
loginUrlUnderlyingCallsCount = newValue
|
||||||
|
} else {
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
loginUrlUnderlyingCallsCount = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
open var loginUrlCalled: Bool {
|
||||||
|
return loginUrlCallsCount > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
var loginUrlUnderlyingReturnValue: String!
|
||||||
|
open var loginUrlReturnValue: String! {
|
||||||
|
get {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
return loginUrlUnderlyingReturnValue
|
||||||
|
} else {
|
||||||
|
var returnValue: String? = nil
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
returnValue = loginUrlUnderlyingReturnValue
|
||||||
|
}
|
||||||
|
|
||||||
|
return returnValue!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
loginUrlUnderlyingReturnValue = newValue
|
||||||
|
} else {
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
loginUrlUnderlyingReturnValue = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
open var loginUrlClosure: (() -> String)?
|
||||||
|
|
||||||
|
open override func loginUrl() -> String {
|
||||||
|
loginUrlCallsCount += 1
|
||||||
|
if let loginUrlClosure = loginUrlClosure {
|
||||||
|
return loginUrlClosure()
|
||||||
|
} else {
|
||||||
|
return loginUrlReturnValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
open class QrCodeDataSDKMock: MatrixRustSDK.QrCodeData {
|
open class QrCodeDataSDKMock: MatrixRustSDK.QrCodeData {
|
||||||
init() {
|
init() {
|
||||||
super.init(noPointer: .init())
|
super.init(noPointer: .init())
|
||||||
@@ -14819,6 +14819,71 @@ open class RoomListItemSDKMock: MatrixRustSDK.RoomListItem {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//MARK: - isEncrypted
|
||||||
|
|
||||||
|
var isEncryptedUnderlyingCallsCount = 0
|
||||||
|
open var isEncryptedCallsCount: Int {
|
||||||
|
get {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
return isEncryptedUnderlyingCallsCount
|
||||||
|
} else {
|
||||||
|
var returnValue: Int? = nil
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
returnValue = isEncryptedUnderlyingCallsCount
|
||||||
|
}
|
||||||
|
|
||||||
|
return returnValue!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
isEncryptedUnderlyingCallsCount = newValue
|
||||||
|
} else {
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
isEncryptedUnderlyingCallsCount = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
open var isEncryptedCalled: Bool {
|
||||||
|
return isEncryptedCallsCount > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
var isEncryptedUnderlyingReturnValue: Bool!
|
||||||
|
open var isEncryptedReturnValue: Bool! {
|
||||||
|
get {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
return isEncryptedUnderlyingReturnValue
|
||||||
|
} else {
|
||||||
|
var returnValue: Bool? = nil
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
returnValue = isEncryptedUnderlyingReturnValue
|
||||||
|
}
|
||||||
|
|
||||||
|
return returnValue!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
isEncryptedUnderlyingReturnValue = newValue
|
||||||
|
} else {
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
isEncryptedUnderlyingReturnValue = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
open var isEncryptedClosure: (() async -> Bool)?
|
||||||
|
|
||||||
|
open override func isEncrypted() async -> Bool {
|
||||||
|
isEncryptedCallsCount += 1
|
||||||
|
if let isEncryptedClosure = isEncryptedClosure {
|
||||||
|
return await isEncryptedClosure()
|
||||||
|
} else {
|
||||||
|
return isEncryptedReturnValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//MARK: - isTimelineInitialized
|
//MARK: - isTimelineInitialized
|
||||||
|
|
||||||
var isTimelineInitializedUnderlyingCallsCount = 0
|
var isTimelineInitializedUnderlyingCallsCount = 0
|
||||||
@@ -15755,6 +15820,86 @@ open class SendAttachmentJoinHandleSDKMock: MatrixRustSDK.SendAttachmentJoinHand
|
|||||||
try await joinClosure?()
|
try await joinClosure?()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
open class SendHandleSDKMock: MatrixRustSDK.SendHandle {
|
||||||
|
init() {
|
||||||
|
super.init(noPointer: .init())
|
||||||
|
}
|
||||||
|
|
||||||
|
public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) {
|
||||||
|
fatalError("init(unsafeFromRawPointer:) has not been implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
fileprivate var pointer: UnsafeMutableRawPointer!
|
||||||
|
|
||||||
|
//MARK: - abort
|
||||||
|
|
||||||
|
open var abortThrowableError: Error?
|
||||||
|
var abortUnderlyingCallsCount = 0
|
||||||
|
open var abortCallsCount: Int {
|
||||||
|
get {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
return abortUnderlyingCallsCount
|
||||||
|
} else {
|
||||||
|
var returnValue: Int? = nil
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
returnValue = abortUnderlyingCallsCount
|
||||||
|
}
|
||||||
|
|
||||||
|
return returnValue!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
abortUnderlyingCallsCount = newValue
|
||||||
|
} else {
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
abortUnderlyingCallsCount = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
open var abortCalled: Bool {
|
||||||
|
return abortCallsCount > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
var abortUnderlyingReturnValue: Bool!
|
||||||
|
open var abortReturnValue: Bool! {
|
||||||
|
get {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
return abortUnderlyingReturnValue
|
||||||
|
} else {
|
||||||
|
var returnValue: Bool? = nil
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
returnValue = abortUnderlyingReturnValue
|
||||||
|
}
|
||||||
|
|
||||||
|
return returnValue!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
abortUnderlyingReturnValue = newValue
|
||||||
|
} else {
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
abortUnderlyingReturnValue = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
open var abortClosure: (() async throws -> Bool)?
|
||||||
|
|
||||||
|
open override func abort() async throws -> Bool {
|
||||||
|
if let error = abortThrowableError {
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
abortCallsCount += 1
|
||||||
|
if let abortClosure = abortClosure {
|
||||||
|
return try await abortClosure()
|
||||||
|
} else {
|
||||||
|
return abortReturnValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
open class SessionVerificationControllerSDKMock: MatrixRustSDK.SessionVerificationController {
|
open class SessionVerificationControllerSDKMock: MatrixRustSDK.SessionVerificationController {
|
||||||
init() {
|
init() {
|
||||||
super.init(noPointer: .init())
|
super.init(noPointer: .init())
|
||||||
@@ -17056,16 +17201,16 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline {
|
|||||||
|
|
||||||
//MARK: - edit
|
//MARK: - edit
|
||||||
|
|
||||||
open var editNewContentEventIdThrowableError: Error?
|
open var editItemNewContentThrowableError: Error?
|
||||||
var editNewContentEventIdUnderlyingCallsCount = 0
|
var editItemNewContentUnderlyingCallsCount = 0
|
||||||
open var editNewContentEventIdCallsCount: Int {
|
open var editItemNewContentCallsCount: Int {
|
||||||
get {
|
get {
|
||||||
if Thread.isMainThread {
|
if Thread.isMainThread {
|
||||||
return editNewContentEventIdUnderlyingCallsCount
|
return editItemNewContentUnderlyingCallsCount
|
||||||
} else {
|
} else {
|
||||||
var returnValue: Int? = nil
|
var returnValue: Int? = nil
|
||||||
DispatchQueue.main.sync {
|
DispatchQueue.main.sync {
|
||||||
returnValue = editNewContentEventIdUnderlyingCallsCount
|
returnValue = editItemNewContentUnderlyingCallsCount
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnValue!
|
return returnValue!
|
||||||
@@ -17073,31 +17218,106 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline {
|
|||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
if Thread.isMainThread {
|
if Thread.isMainThread {
|
||||||
editNewContentEventIdUnderlyingCallsCount = newValue
|
editItemNewContentUnderlyingCallsCount = newValue
|
||||||
} else {
|
} else {
|
||||||
DispatchQueue.main.sync {
|
DispatchQueue.main.sync {
|
||||||
editNewContentEventIdUnderlyingCallsCount = newValue
|
editItemNewContentUnderlyingCallsCount = newValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
open var editNewContentEventIdCalled: Bool {
|
open var editItemNewContentCalled: Bool {
|
||||||
return editNewContentEventIdCallsCount > 0
|
return editItemNewContentCallsCount > 0
|
||||||
}
|
}
|
||||||
open var editNewContentEventIdReceivedArguments: (newContent: RoomMessageEventContentWithoutRelation, eventId: String)?
|
open var editItemNewContentReceivedArguments: (item: EventTimelineItem, newContent: RoomMessageEventContentWithoutRelation)?
|
||||||
open var editNewContentEventIdReceivedInvocations: [(newContent: RoomMessageEventContentWithoutRelation, eventId: String)] = []
|
open var editItemNewContentReceivedInvocations: [(item: EventTimelineItem, newContent: RoomMessageEventContentWithoutRelation)] = []
|
||||||
open var editNewContentEventIdClosure: ((RoomMessageEventContentWithoutRelation, String) async throws -> Void)?
|
|
||||||
|
|
||||||
open override func edit(newContent: RoomMessageEventContentWithoutRelation, eventId: String) async throws {
|
var editItemNewContentUnderlyingReturnValue: Bool!
|
||||||
if let error = editNewContentEventIdThrowableError {
|
open var editItemNewContentReturnValue: Bool! {
|
||||||
|
get {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
return editItemNewContentUnderlyingReturnValue
|
||||||
|
} else {
|
||||||
|
var returnValue: Bool? = nil
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
returnValue = editItemNewContentUnderlyingReturnValue
|
||||||
|
}
|
||||||
|
|
||||||
|
return returnValue!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
editItemNewContentUnderlyingReturnValue = newValue
|
||||||
|
} else {
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
editItemNewContentUnderlyingReturnValue = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
open var editItemNewContentClosure: ((EventTimelineItem, RoomMessageEventContentWithoutRelation) async throws -> Bool)?
|
||||||
|
|
||||||
|
open override func edit(item: EventTimelineItem, newContent: RoomMessageEventContentWithoutRelation) async throws -> Bool {
|
||||||
|
if let error = editItemNewContentThrowableError {
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
editNewContentEventIdCallsCount += 1
|
editItemNewContentCallsCount += 1
|
||||||
editNewContentEventIdReceivedArguments = (newContent: newContent, eventId: eventId)
|
editItemNewContentReceivedArguments = (item: item, newContent: newContent)
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
self.editNewContentEventIdReceivedInvocations.append((newContent: newContent, eventId: eventId))
|
self.editItemNewContentReceivedInvocations.append((item: item, newContent: newContent))
|
||||||
}
|
}
|
||||||
try await editNewContentEventIdClosure?(newContent, eventId)
|
if let editItemNewContentClosure = editItemNewContentClosure {
|
||||||
|
return try await editItemNewContentClosure(item, newContent)
|
||||||
|
} else {
|
||||||
|
return editItemNewContentReturnValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//MARK: - editByEventId
|
||||||
|
|
||||||
|
open var editByEventIdEventIdNewContentThrowableError: Error?
|
||||||
|
var editByEventIdEventIdNewContentUnderlyingCallsCount = 0
|
||||||
|
open var editByEventIdEventIdNewContentCallsCount: Int {
|
||||||
|
get {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
return editByEventIdEventIdNewContentUnderlyingCallsCount
|
||||||
|
} else {
|
||||||
|
var returnValue: Int? = nil
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
returnValue = editByEventIdEventIdNewContentUnderlyingCallsCount
|
||||||
|
}
|
||||||
|
|
||||||
|
return returnValue!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
editByEventIdEventIdNewContentUnderlyingCallsCount = newValue
|
||||||
|
} else {
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
editByEventIdEventIdNewContentUnderlyingCallsCount = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
open var editByEventIdEventIdNewContentCalled: Bool {
|
||||||
|
return editByEventIdEventIdNewContentCallsCount > 0
|
||||||
|
}
|
||||||
|
open var editByEventIdEventIdNewContentReceivedArguments: (eventId: String, newContent: RoomMessageEventContentWithoutRelation)?
|
||||||
|
open var editByEventIdEventIdNewContentReceivedInvocations: [(eventId: String, newContent: RoomMessageEventContentWithoutRelation)] = []
|
||||||
|
open var editByEventIdEventIdNewContentClosure: ((String, RoomMessageEventContentWithoutRelation) async throws -> Void)?
|
||||||
|
|
||||||
|
open override func editByEventId(eventId: String, newContent: RoomMessageEventContentWithoutRelation) async throws {
|
||||||
|
if let error = editByEventIdEventIdNewContentThrowableError {
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
editByEventIdEventIdNewContentCallsCount += 1
|
||||||
|
editByEventIdEventIdNewContentReceivedArguments = (eventId: eventId, newContent: newContent)
|
||||||
|
DispatchQueue.main.async {
|
||||||
|
self.editByEventIdEventIdNewContentReceivedInvocations.append((eventId: eventId, newContent: newContent))
|
||||||
|
}
|
||||||
|
try await editByEventIdEventIdNewContentClosure?(eventId, newContent)
|
||||||
}
|
}
|
||||||
|
|
||||||
//MARK: - editPoll
|
//MARK: - editPoll
|
||||||
@@ -17845,13 +18065,13 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline {
|
|||||||
open var sendMsgReceivedMsg: RoomMessageEventContentWithoutRelation?
|
open var sendMsgReceivedMsg: RoomMessageEventContentWithoutRelation?
|
||||||
open var sendMsgReceivedInvocations: [RoomMessageEventContentWithoutRelation] = []
|
open var sendMsgReceivedInvocations: [RoomMessageEventContentWithoutRelation] = []
|
||||||
|
|
||||||
var sendMsgUnderlyingReturnValue: AbortSendHandle!
|
var sendMsgUnderlyingReturnValue: SendHandle!
|
||||||
open var sendMsgReturnValue: AbortSendHandle! {
|
open var sendMsgReturnValue: SendHandle! {
|
||||||
get {
|
get {
|
||||||
if Thread.isMainThread {
|
if Thread.isMainThread {
|
||||||
return sendMsgUnderlyingReturnValue
|
return sendMsgUnderlyingReturnValue
|
||||||
} else {
|
} else {
|
||||||
var returnValue: AbortSendHandle? = nil
|
var returnValue: SendHandle? = nil
|
||||||
DispatchQueue.main.sync {
|
DispatchQueue.main.sync {
|
||||||
returnValue = sendMsgUnderlyingReturnValue
|
returnValue = sendMsgUnderlyingReturnValue
|
||||||
}
|
}
|
||||||
@@ -17869,9 +18089,9 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
open var sendMsgClosure: ((RoomMessageEventContentWithoutRelation) async throws -> AbortSendHandle)?
|
open var sendMsgClosure: ((RoomMessageEventContentWithoutRelation) async throws -> SendHandle)?
|
||||||
|
|
||||||
open override func send(msg: RoomMessageEventContentWithoutRelation) async throws -> AbortSendHandle {
|
open override func send(msg: RoomMessageEventContentWithoutRelation) async throws -> SendHandle {
|
||||||
if let error = sendMsgThrowableError {
|
if let error = sendMsgThrowableError {
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,7 +114,6 @@ enum RoomScreenViewAction {
|
|||||||
case displayRoomMemberDetails(userID: String)
|
case displayRoomMemberDetails(userID: String)
|
||||||
case displayReactionSummary(itemID: TimelineItemIdentifier, key: String)
|
case displayReactionSummary(itemID: TimelineItemIdentifier, key: String)
|
||||||
case displayEmojiPicker(itemID: TimelineItemIdentifier)
|
case displayEmojiPicker(itemID: TimelineItemIdentifier)
|
||||||
case displayMessageSendingFailureAlert(itemID: TimelineItemIdentifier)
|
|
||||||
case displayReadReceipts(itemID: TimelineItemIdentifier)
|
case displayReadReceipts(itemID: TimelineItemIdentifier)
|
||||||
case displayCall
|
case displayCall
|
||||||
|
|
||||||
@@ -216,7 +215,6 @@ struct ReadReceiptSummaryInfo: Identifiable {
|
|||||||
enum RoomScreenAlertInfoType: Hashable {
|
enum RoomScreenAlertInfoType: Hashable {
|
||||||
case audioRecodingPermissionError
|
case audioRecodingPermissionError
|
||||||
case pollEndConfirmation(String)
|
case pollEndConfirmation(String)
|
||||||
case messageSendingFailure(TimelineItemIdentifier)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct RoomMemberState {
|
struct RoomMemberState {
|
||||||
|
|||||||
@@ -178,8 +178,6 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
|
|||||||
roomScreenInteractionHandler.displayEmojiPicker(for: itemID)
|
roomScreenInteractionHandler.displayEmojiPicker(for: itemID)
|
||||||
case .displayReactionSummary(let itemID, let key):
|
case .displayReactionSummary(let itemID, let key):
|
||||||
displayReactionSummary(for: itemID, selectedKey: key)
|
displayReactionSummary(for: itemID, selectedKey: key)
|
||||||
case .displayMessageSendingFailureAlert(let itemID):
|
|
||||||
displayAlert(.messageSendingFailure(itemID))
|
|
||||||
case .displayReadReceipts(itemID: let itemID):
|
case .displayReadReceipts(itemID: let itemID):
|
||||||
displayReadReceipts(for: itemID)
|
displayReadReceipts(for: itemID)
|
||||||
case .displayCall:
|
case .displayCall:
|
||||||
@@ -764,12 +762,6 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
|
|||||||
message: L10n.commonPollEndConfirmation,
|
message: L10n.commonPollEndConfirmation,
|
||||||
primaryButton: .init(title: L10n.actionCancel, role: .cancel, action: nil),
|
primaryButton: .init(title: L10n.actionCancel, role: .cancel, action: nil),
|
||||||
secondaryButton: .init(title: L10n.actionOk, action: { self.roomScreenInteractionHandler.endPoll(pollStartID: pollStartID) }))
|
secondaryButton: .init(title: L10n.actionOk, action: { self.roomScreenInteractionHandler.endPoll(pollStartID: pollStartID) }))
|
||||||
case .messageSendingFailure(let itemID):
|
|
||||||
state.bindings.alertInfo = .init(id: type, title: L10n.screenRoomRetrySendMenuTitle, primaryButton: .init(title: L10n.actionRemove, role: .destructive) {
|
|
||||||
Task {
|
|
||||||
await self.timelineController.redact(itemID)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -110,11 +110,7 @@ struct TimelineItemBubbledStylerView<Content: View>: View {
|
|||||||
VStack(alignment: alignment, spacing: -3) {
|
VStack(alignment: alignment, spacing: -3) {
|
||||||
messageBubble
|
messageBubble
|
||||||
.timelineItemAccessibility(timelineItem) {
|
.timelineItemAccessibility(timelineItem) {
|
||||||
if adjustedDeliveryStatus == .sendingFailed {
|
context.send(viewAction: .displayTimelineItemMenu(itemID: timelineItem.id))
|
||||||
context.send(viewAction: .displayMessageSendingFailureAlert(itemID: timelineItem.id))
|
|
||||||
} else {
|
|
||||||
context.send(viewAction: .displayTimelineItemMenu(itemID: timelineItem.id))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if !timelineItem.properties.reactions.isEmpty {
|
if !timelineItem.properties.reactions.isEmpty {
|
||||||
@@ -168,22 +164,10 @@ struct TimelineItemBubbledStylerView<Content: View>: View {
|
|||||||
timelineItem.bubbleSendInfoLayoutType
|
timelineItem.bubbleSendInfoLayoutType
|
||||||
.layout {
|
.layout {
|
||||||
contentWithReply
|
contentWithReply
|
||||||
interactiveLocalizedSendInfo
|
layoutedLocalizedSendInfo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ViewBuilder
|
|
||||||
var interactiveLocalizedSendInfo: some View {
|
|
||||||
if adjustedDeliveryStatus == .sendingFailed {
|
|
||||||
layoutedLocalizedSendInfo
|
|
||||||
.onTapGesture {
|
|
||||||
context.send(viewAction: .displayMessageSendingFailureAlert(itemID: timelineItem.id))
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
layoutedLocalizedSendInfo
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
var layoutedLocalizedSendInfo: some View {
|
var layoutedLocalizedSendInfo: some View {
|
||||||
switch timelineItem.bubbleSendInfoLayoutType {
|
switch timelineItem.bubbleSendInfoLayoutType {
|
||||||
|
|||||||
Reference in New Issue
Block a user