mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:31:27 +00:00
using roomPreview API for invited rooms (#3530)
* using roomPreview for invited rooms * Update ElementX/Sources/Services/Room/RoomInfoProxy.swift Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com> * improved code * fix, but requires a SDK PR * update sdk * package resolved * fixed the tests --------- Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>
This commit is contained in:
@@ -5831,11 +5831,12 @@ class ElementCallWidgetDriverMock: ElementCallWidgetDriverProtocol {
|
||||
}
|
||||
}
|
||||
class InvitedRoomProxyMock: InvitedRoomProxyProtocol {
|
||||
var info: RoomInfoProxy {
|
||||
var info: BaseRoomInfoProxyProtocol {
|
||||
get { return underlyingInfo }
|
||||
set(value) { underlyingInfo = value }
|
||||
}
|
||||
var underlyingInfo: RoomInfoProxy!
|
||||
var underlyingInfo: BaseRoomInfoProxyProtocol!
|
||||
var inviter: RoomMemberProxyProtocol?
|
||||
var id: String {
|
||||
get { return underlyingId }
|
||||
set(value) { underlyingId = value }
|
||||
@@ -5911,70 +5912,6 @@ class InvitedRoomProxyMock: InvitedRoomProxyProtocol {
|
||||
return rejectInvitationReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - acceptInvitation
|
||||
|
||||
var acceptInvitationUnderlyingCallsCount = 0
|
||||
var acceptInvitationCallsCount: Int {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return acceptInvitationUnderlyingCallsCount
|
||||
} else {
|
||||
var returnValue: Int? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = acceptInvitationUnderlyingCallsCount
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
acceptInvitationUnderlyingCallsCount = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
acceptInvitationUnderlyingCallsCount = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var acceptInvitationCalled: Bool {
|
||||
return acceptInvitationCallsCount > 0
|
||||
}
|
||||
|
||||
var acceptInvitationUnderlyingReturnValue: Result<Void, RoomProxyError>!
|
||||
var acceptInvitationReturnValue: Result<Void, RoomProxyError>! {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return acceptInvitationUnderlyingReturnValue
|
||||
} else {
|
||||
var returnValue: Result<Void, RoomProxyError>? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = acceptInvitationUnderlyingReturnValue
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
acceptInvitationUnderlyingReturnValue = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
acceptInvitationUnderlyingReturnValue = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var acceptInvitationClosure: (() async -> Result<Void, RoomProxyError>)?
|
||||
|
||||
func acceptInvitation() async -> Result<Void, RoomProxyError> {
|
||||
acceptInvitationCallsCount += 1
|
||||
if let acceptInvitationClosure = acceptInvitationClosure {
|
||||
return await acceptInvitationClosure()
|
||||
} else {
|
||||
return acceptInvitationReturnValue
|
||||
}
|
||||
}
|
||||
}
|
||||
class JoinedRoomProxyMock: JoinedRoomProxyProtocol {
|
||||
var isEncrypted: Bool {
|
||||
|
||||
Reference in New Issue
Block a user