Skip to content

Commit

Permalink
Show error screens in group calls
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
robintown committed Feb 23, 2025
1 parent 3de025c commit a3667c3
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit a3667c3

Please sign in to comment.