Fixes #3042 - Cancel ElementCall ringing as soon as the call ends

This commit is contained in:
Stefan Ceriu
2024-07-16 17:09:16 +03:00
committed by Stefan Ceriu
parent d16ba9f3ef
commit 239afeb662
9 changed files with 188 additions and 18 deletions
+11 -7
View File
@@ -155,6 +155,17 @@ class RoomProxy: RoomProxyProtocol {
subscribeToTypingNotifications()
}
func subscribeToRoomInfoUpdates() {
guard roomInfoObservationToken == nil else {
return
}
roomInfoObservationToken = room.subscribeToRoomInfoUpdates(listener: RoomInfoUpdateListener { [weak self] in
MXLog.info("Received room info update")
self?.actionsSubject.send(.roomInfoUpdate)
})
}
func timelineFocusedOnEvent(eventID: String, numberOfEvents: UInt16) async -> Result<TimelineProxyProtocol, RoomProxyError> {
do {
let timeline = try await room.timelineFocusedOnEvent(eventId: eventID, numContextEvents: numberOfEvents, internalIdPrefix: UUID().uuidString)
@@ -596,13 +607,6 @@ class RoomProxy: RoomProxyProtocol {
// MARK: - Private
private func subscribeToRoomInfoUpdates() {
roomInfoObservationToken = room.subscribeToRoomInfoUpdates(listener: RoomInfoUpdateListener { [weak self] in
MXLog.info("Received room info update")
self?.actionsSubject.send(.roomInfoUpdate)
})
}
private func subscribeToTypingNotifications() {
typingNotificationObservationToken = room.subscribeToTypingNotifications(listener: RoomTypingNotificationUpdateListener { [weak self] typingUserIDs in
guard let self else { return }
@@ -66,6 +66,8 @@ protocol RoomProxyProtocol {
func subscribeForUpdates() async
func subscribeToRoomInfoUpdates()
func timelineFocusedOnEvent(eventID: String, numberOfEvents: UInt16) async -> Result<TimelineProxyProtocol, RoomProxyError>
func redact(_ eventID: String) async -> Result<Void, RoomProxyError>