mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
removed identifier in the UIAction for opening a URL, also added a function to get a thread root from any event
This commit is contained in:
@@ -6483,6 +6483,76 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable {
|
||||
return threadTimelineEventIDReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - getThreadRootEventID
|
||||
|
||||
var getThreadRootEventIDForUnderlyingCallsCount = 0
|
||||
var getThreadRootEventIDForCallsCount: Int {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return getThreadRootEventIDForUnderlyingCallsCount
|
||||
} else {
|
||||
var returnValue: Int? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = getThreadRootEventIDForUnderlyingCallsCount
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
getThreadRootEventIDForUnderlyingCallsCount = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
getThreadRootEventIDForUnderlyingCallsCount = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var getThreadRootEventIDForCalled: Bool {
|
||||
return getThreadRootEventIDForCallsCount > 0
|
||||
}
|
||||
var getThreadRootEventIDForReceivedEventID: String?
|
||||
var getThreadRootEventIDForReceivedInvocations: [String] = []
|
||||
|
||||
var getThreadRootEventIDForUnderlyingReturnValue: Result<String?, RoomProxyError>!
|
||||
var getThreadRootEventIDForReturnValue: Result<String?, RoomProxyError>! {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return getThreadRootEventIDForUnderlyingReturnValue
|
||||
} else {
|
||||
var returnValue: Result<String?, RoomProxyError>? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = getThreadRootEventIDForUnderlyingReturnValue
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
getThreadRootEventIDForUnderlyingReturnValue = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
getThreadRootEventIDForUnderlyingReturnValue = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var getThreadRootEventIDForClosure: ((String) async -> Result<String?, RoomProxyError>)?
|
||||
|
||||
func getThreadRootEventID(for eventID: String) async -> Result<String?, RoomProxyError> {
|
||||
getThreadRootEventIDForCallsCount += 1
|
||||
getThreadRootEventIDForReceivedEventID = eventID
|
||||
DispatchQueue.main.async {
|
||||
self.getThreadRootEventIDForReceivedInvocations.append(eventID)
|
||||
}
|
||||
if let getThreadRootEventIDForClosure = getThreadRootEventIDForClosure {
|
||||
return await getThreadRootEventIDForClosure(eventID)
|
||||
} else {
|
||||
return getThreadRootEventIDForReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - messageFilteredTimeline
|
||||
|
||||
var messageFilteredTimelineFocusAllowedMessageTypesPresentationUnderlyingCallsCount = 0
|
||||
|
||||
Reference in New Issue
Block a user