mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 03:36:07 +03:00
Make end call button work for conf calls
This commit is contained in:
parent
cb89d3760a
commit
5004a3a5b3
2 changed files with 16 additions and 5 deletions
|
@ -264,9 +264,16 @@ if (!global.mxCallHandler) {
|
||||||
|
|
||||||
var callHandler = {
|
var callHandler = {
|
||||||
getCallForRoom: function(roomId) {
|
getCallForRoom: function(roomId) {
|
||||||
return (
|
var call = module.exports.getCall(roomId);
|
||||||
module.exports.getCall(roomId)
|
if (call) return call;
|
||||||
);
|
|
||||||
|
if (Modulator.hasConferenceHandler()) {
|
||||||
|
var ConferenceHandler = Modulator.getConferenceHandler();
|
||||||
|
call = ConferenceHandler.getConferenceCallForRoom(roomId);
|
||||||
|
}
|
||||||
|
if (call) return call;
|
||||||
|
|
||||||
|
return null;
|
||||||
},
|
},
|
||||||
|
|
||||||
getCall: function(roomId) {
|
getCall: function(roomId) {
|
||||||
|
|
|
@ -44,7 +44,7 @@ module.exports = {
|
||||||
componentDidMount: function() {
|
componentDidMount: function() {
|
||||||
this.dispatcherRef = dis.register(this.onAction);
|
this.dispatcherRef = dis.register(this.onAction);
|
||||||
if (this.props.room) {
|
if (this.props.room) {
|
||||||
var call = CallHandler.getCall(this.props.room.roomId);
|
var call = CallHandler.getCallForRoom(this.props.room.roomId);
|
||||||
var callState = call ? call.call_state : "ended";
|
var callState = call ? call.call_state : "ended";
|
||||||
this.setState({
|
this.setState({
|
||||||
call_state: callState
|
call_state: callState
|
||||||
|
@ -87,9 +87,13 @@ module.exports = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onHangupClick: function() {
|
onHangupClick: function() {
|
||||||
|
var call = CallHandler.getCallForRoom(this.props.room.roomId);
|
||||||
|
if (!call) { return; }
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
action: 'hangup',
|
action: 'hangup',
|
||||||
room_id: this.props.room.roomId
|
// 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…
Reference in a new issue