Show error screens in group calls (#3813)

Element Call now sends a 'close' widget action when the widget is ready to close. Usually this will be sent immediately after the 'hangup' action, but it could be sent later if the widget wants to present an error screen before closing. So by listening to the 'close' action rather than the 'hangup' action, we get to see these error screens.
This commit is contained in:
Robin
2025-02-24 17:09:30 +07:00
committed by GitHub
parent 97a4f4fcfe
commit e9fa0ce5f2

View File

@@ -17,6 +17,7 @@ struct ElementCallWidgetMessage: Codable {
enum Action: String, Codable {
case hangup = "im.vector.hangup"
case close = "io.element.close"
case mediaState = "io.element.device_mute"
}
@@ -181,6 +182,8 @@ class ElementCallWidgetDriver: WidgetCapabilitiesProvider, ElementCallWidgetDriv
if widgetMessage.direction == .fromWidget {
switch widgetMessage.action {
case .hangup:
break
case .close:
actionsSubject.send(.callEnded)
case .mediaState:
guard let audioEnabled = widgetMessage.data.audioEnabled,