Support rejecting calls
Use the 'reject' method when we want to reject an incoming call rather than end one that's in progress. Also get our error messages right for the other side rejecting the call (albeit still with placeholder dialog-box UX). Requires https://github.com/matrix-org/matrix-js-sdk/pull/1510
This commit is contained in:
parent
f60dff5f0c
commit
7ad366603a
6 changed files with 58 additions and 8 deletions
|
@ -38,6 +38,7 @@ import WidgetUtils from "../../../utils/WidgetUtils";
|
|||
import {UPDATE_EVENT} from "../../../stores/AsyncStore";
|
||||
import ActiveWidgetStore from "../../../stores/ActiveWidgetStore";
|
||||
import { PlaceCallType } from "../../../CallHandler";
|
||||
import { CallState } from 'matrix-js-sdk/src/webrtc/call';
|
||||
|
||||
function ComposerAvatar(props) {
|
||||
const MemberStatusMessageAvatar = sdk.getComponent('avatars.MemberStatusMessageAvatar');
|
||||
|
@ -104,8 +105,11 @@ function HangupButton(props) {
|
|||
if (!call) {
|
||||
return;
|
||||
}
|
||||
|
||||
const action = call.state === CallState.Ringing ? 'reject' : 'hangup';
|
||||
|
||||
dis.dispatch({
|
||||
action: 'hangup',
|
||||
action,
|
||||
// hangup the call for this room, which may not be the room in props
|
||||
// (e.g. conferences which will hangup the 1:1 room instead)
|
||||
room_id: call.roomId,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue