mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-29 21:15:19 +00:00
Merge pull request #3046 from element-hq/robin/close-action-patch
Patch for v0.7: Send a 'close' action when the widget is ready to close
This commit is contained in:
@@ -135,7 +135,20 @@ const widgetPostHangupProcedure = async (
|
|||||||
// We send the hangup event after the memberships have been updated
|
// We send the hangup event after the memberships have been updated
|
||||||
// calling leaveRTCSession.
|
// calling leaveRTCSession.
|
||||||
// We need to wait because this makes the client hosting this widget killing the IFrame.
|
// We need to wait because this makes the client hosting this widget killing the IFrame.
|
||||||
await widget.api.transport.send(ElementWidgetActions.HangupCall, {});
|
try {
|
||||||
|
await widget.api.transport.send(ElementWidgetActions.HangupCall, {});
|
||||||
|
} catch (e) {
|
||||||
|
logger.error("Failed to send hangup action", e);
|
||||||
|
}
|
||||||
|
// To make the hangup procedure behave more similarly to what future versions
|
||||||
|
// of Element Call will do, we additionally send a close action (even though
|
||||||
|
// we're not yet employing the distinction between 'hangup' and 'close' to
|
||||||
|
// display error screens)
|
||||||
|
try {
|
||||||
|
await widget.api.transport.send(ElementWidgetActions.Close, {});
|
||||||
|
} catch (e) {
|
||||||
|
logger.error("Failed to send close action", e);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export async function leaveRTCSession(
|
export async function leaveRTCSession(
|
||||||
|
|||||||
@@ -17,10 +17,11 @@ import { getUrlParams } from "./UrlParams";
|
|||||||
import { Config } from "./config/Config";
|
import { Config } from "./config/Config";
|
||||||
import { ElementCallReactionEventType } from "./reactions";
|
import { ElementCallReactionEventType } from "./reactions";
|
||||||
|
|
||||||
// Subset of the actions in matrix-react-sdk
|
// Subset of the actions in element-web
|
||||||
export enum ElementWidgetActions {
|
export enum ElementWidgetActions {
|
||||||
JoinCall = "io.element.join",
|
JoinCall = "io.element.join",
|
||||||
HangupCall = "im.vector.hangup",
|
HangupCall = "im.vector.hangup",
|
||||||
|
Close = "io.element.close",
|
||||||
TileLayout = "io.element.tile_layout",
|
TileLayout = "io.element.tile_layout",
|
||||||
SpotlightLayout = "io.element.spotlight_layout",
|
SpotlightLayout = "io.element.spotlight_layout",
|
||||||
// This can be sent as from or to widget
|
// This can be sent as from or to widget
|
||||||
|
|||||||
Reference in New Issue
Block a user