Merge pull request #4297 from robintown/ec-close
Show error screens in group calls
This commit is contained in:
commit
fc4130310c
3 changed files with 6 additions and 3 deletions
|
|
@ -33,6 +33,9 @@ data class WidgetMessage(
|
||||||
@SerialName("im.vector.hangup")
|
@SerialName("im.vector.hangup")
|
||||||
HangUp,
|
HangUp,
|
||||||
|
|
||||||
|
@SerialName("io.element.close")
|
||||||
|
Close,
|
||||||
|
|
||||||
@SerialName("send_event")
|
@SerialName("send_event")
|
||||||
SendEvent,
|
SendEvent,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ class CallScreenPresenter @AssistedInject constructor(
|
||||||
|
|
||||||
val parsedMessage = parseMessage(it)
|
val parsedMessage = parseMessage(it)
|
||||||
if (parsedMessage?.direction == WidgetMessage.Direction.FromWidget) {
|
if (parsedMessage?.direction == WidgetMessage.Direction.FromWidget) {
|
||||||
if (parsedMessage.action == WidgetMessage.Action.HangUp) {
|
if (parsedMessage.action == WidgetMessage.Action.Close) {
|
||||||
close(callWidgetDriver.value, navigator)
|
close(callWidgetDriver.value, navigator)
|
||||||
} else if (parsedMessage.action == WidgetMessage.Action.SendEvent) {
|
} else if (parsedMessage.action == WidgetMessage.Action.SendEvent) {
|
||||||
// This event is received when a member joins the call, the first one will be the current one
|
// This event is received when a member joins the call, the first one will be the current one
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,7 @@ class CallScreenPresenterTest {
|
||||||
|
|
||||||
@OptIn(ExperimentalCoroutinesApi::class)
|
@OptIn(ExperimentalCoroutinesApi::class)
|
||||||
@Test
|
@Test
|
||||||
fun `present - a received hang up message closes the screen and stops the widget driver`() = runTest(UnconfinedTestDispatcher()) {
|
fun `present - a received close message closes the screen and stops the widget driver`() = runTest(UnconfinedTestDispatcher()) {
|
||||||
val navigator = FakeCallScreenNavigator()
|
val navigator = FakeCallScreenNavigator()
|
||||||
val widgetDriver = FakeMatrixWidgetDriver()
|
val widgetDriver = FakeMatrixWidgetDriver()
|
||||||
val presenter = createCallScreenPresenter(
|
val presenter = createCallScreenPresenter(
|
||||||
|
|
@ -191,7 +191,7 @@ class CallScreenPresenterTest {
|
||||||
val initialState = awaitItem()
|
val initialState = awaitItem()
|
||||||
initialState.eventSink(CallScreenEvents.SetupMessageChannels(messageInterceptor))
|
initialState.eventSink(CallScreenEvents.SetupMessageChannels(messageInterceptor))
|
||||||
|
|
||||||
messageInterceptor.givenInterceptedMessage("""{"action":"im.vector.hangup","api":"fromWidget","widgetId":"1","requestId":"1"}""")
|
messageInterceptor.givenInterceptedMessage("""{"action":"io.element.close","api":"fromWidget","widgetId":"1","requestId":"1"}""")
|
||||||
|
|
||||||
// Let background coroutines run
|
// Let background coroutines run
|
||||||
runCurrent()
|
runCurrent()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue