Merge pull request #5223 from matrix-org/travis/ft-sep1620/04-jitsi-hangup
Make the hangup button do things for conference calls
This commit is contained in:
commit
5534206e77
7 changed files with 144 additions and 42 deletions
|
@ -22,6 +22,7 @@ import { AsyncStoreWithClient } from "./AsyncStoreWithClient";
|
|||
import defaultDispatcher from "../dispatcher/dispatcher";
|
||||
import SettingsStore from "../settings/SettingsStore";
|
||||
import WidgetEchoStore from "../stores/WidgetEchoStore";
|
||||
import ActiveWidgetStore from "../stores/ActiveWidgetStore";
|
||||
import WidgetUtils from "../utils/WidgetUtils";
|
||||
import {SettingLevel} from "../settings/SettingLevel";
|
||||
import {WidgetType} from "../widgets/WidgetType";
|
||||
|
@ -207,6 +208,24 @@ export default class WidgetStore extends AsyncStoreWithClient<IState> {
|
|||
}
|
||||
return roomInfo.widgets;
|
||||
}
|
||||
|
||||
public doesRoomHaveConference(room: Room): boolean {
|
||||
const roomInfo = this.getRoom(room.roomId);
|
||||
if (!roomInfo) return false;
|
||||
|
||||
const currentWidgets = roomInfo.widgets.filter(w => WidgetType.JITSI.matches(w.type));
|
||||
const hasPendingWidgets = WidgetEchoStore.roomHasPendingWidgetsOfType(room.roomId, [], WidgetType.JITSI);
|
||||
return currentWidgets.length > 0 || hasPendingWidgets;
|
||||
}
|
||||
|
||||
public isJoinedToConferenceIn(room: Room): boolean {
|
||||
const roomInfo = this.getRoom(room.roomId);
|
||||
if (!roomInfo) return false;
|
||||
|
||||
// A persistent conference widget indicates that we're participating
|
||||
const widgets = roomInfo.widgets.filter(w => WidgetType.JITSI.matches(w.type));
|
||||
return widgets.some(w => ActiveWidgetStore.getWidgetPersistence(w.id));
|
||||
}
|
||||
}
|
||||
|
||||
window.mxWidgetStore = WidgetStore.instance;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue