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 25a332d
Showing 1 changed file with 2 additions and 1 deletion.
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 @@ -180,7 +181,7 @@ class ElementCallWidgetDriver: WidgetCapabilitiesProvider, ElementCallWidgetDriv
let widgetMessage = try JSONDecoder().decode(ElementCallWidgetMessage.self, from: data)
if widgetMessage.direction == .fromWidget {
switch widgetMessage.action {

Check failure on line 183 in ElementX/Sources/Services/ElementCall/ElementCallWidgetDriver.swift

View workflow job for this annotation

GitHub Actions / Tests

switch must be exhaustive

Check failure on line 183 in ElementX/Sources/Services/ElementCall/ElementCallWidgetDriver.swift

View workflow job for this annotation

GitHub Actions / Tests

switch must be exhaustive
case .hangup:
case .close:
actionsSubject.send(.callEnded)
case .mediaState:
guard let audioEnabled = widgetMessage.data.audioEnabled,
Expand Down

0 comments on commit 25a332d

Please sign in to comment.