Delegate the sending of call notifications to Element Call (#30507)
* Move Element Call event types to a more appropriate file To remove the potential for import cycles in src/models/Call.ts, which I was accidentally creating when I tried to reference data from the RoomListStore in the ElementCall class. * Make sure ElementCall tests clean up the call object * Upgrade Element Call to v0.14.1 * Delegate the sending of call notifications to Element Call As of Element Call version 0.14.0, the widget is now capable of sending call notifications itself if we just request this with the sendNotificationType URL parameter. This makes Element Web's group call code a little bit more succinct. * Fix createRoom test
This commit is contained in:
+5
-4
@@ -42,6 +42,7 @@ import { waitForMember } from "./utils/membership";
|
||||
import { PreferredRoomVersions } from "./utils/PreferredRoomVersions";
|
||||
import SettingsStore from "./settings/SettingsStore";
|
||||
import { MEGOLM_ENCRYPTION_ALGORITHM } from "./utils/crypto";
|
||||
import { ElementCallEventType, ElementCallMemberEventType } from "./call-types";
|
||||
|
||||
// we define a number of interfaces which take their names from the js-sdk
|
||||
/* eslint-disable camelcase */
|
||||
@@ -165,9 +166,9 @@ export default async function createRoom(client: MatrixClient, opts: IOpts): Pro
|
||||
events: {
|
||||
...DEFAULT_EVENT_POWER_LEVELS,
|
||||
// Allow all users to send call membership updates
|
||||
[ElementCall.MEMBER_EVENT_TYPE.name]: 0,
|
||||
[ElementCallMemberEventType.name]: 0,
|
||||
// Make calls immutable, even to admins
|
||||
[ElementCall.CALL_EVENT_TYPE.name]: 200,
|
||||
[ElementCallEventType.name]: 200,
|
||||
},
|
||||
users: {
|
||||
// Temporarily give ourselves the power to set up a call
|
||||
@@ -180,9 +181,9 @@ export default async function createRoom(client: MatrixClient, opts: IOpts): Pro
|
||||
events: {
|
||||
...DEFAULT_EVENT_POWER_LEVELS,
|
||||
// It should always (including non video rooms) be possible to join a group call.
|
||||
[ElementCall.MEMBER_EVENT_TYPE.name]: 0,
|
||||
[ElementCallMemberEventType.name]: 0,
|
||||
// Make sure only admins can enable it (DEPRECATED)
|
||||
[ElementCall.CALL_EVENT_TYPE.name]: 100,
|
||||
[ElementCallEventType.name]: 100,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user