-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Set Element Call "intents" when starting and answering DM calls. #30730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
a613180
8025ab4
1e342c6
cf7d3a4
2f4d845
35569f3
e639144
cafa03e
a9811fd
12e0c5b
dafdd11
69d8f2d
2516b77
3c84360
fb28ec2
7f971d8
9090b1b
329568d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,6 +45,7 @@ | |
| import SdkConfig from "../SdkConfig.ts"; | ||
| import RoomListStore from "../stores/room-list/RoomListStore.ts"; | ||
| import { DefaultTagID } from "../stores/room-list/models.ts"; | ||
| import { getJoinedNonFunctionalMembers } from "../utils/room/getJoinedNonFunctionalMembers.ts"; | ||
|
Check failure on line 48 in src/models/Call.ts
|
||
|
|
||
| const TIMEOUT_MS = 16000; | ||
|
|
||
|
|
@@ -542,6 +543,13 @@ | |
| }; | ||
| } | ||
|
|
||
| export enum ElementCallIntent { | ||
| StartCall = "start_call", | ||
| JoinExisting = "join_existing", | ||
| StartCallDM = "start_call_dm", | ||
| JoinExistingDM = "join_existing_dm", | ||
| } | ||
|
|
||
| /** | ||
| * A group call using MSC3401 and Element Call as a backend. | ||
| * (somewhat cheekily named) | ||
|
|
@@ -586,10 +594,18 @@ | |
|
|
||
| const room = client.getRoom(roomId); | ||
| if (room !== null && !isVideoRoom(room)) { | ||
| params.append( | ||
| "sendNotificationType", | ||
| RoomListStore.instance.getTagsForRoom(room).includes(DefaultTagID.DM) ? "ring" : "notification", | ||
| ); | ||
| const isDM = RoomListStore.instance.getTagsForRoom(room).includes(DefaultTagID.DM); | ||
| params.append("sendNotificationType", isDM ? "ring" : "notification"); | ||
| if (isDM) { | ||
| const oldestMembership = client.matrixRTC.getRoomSession(room).getOldestMembership(); | ||
|
Check failure on line 600 in src/models/Call.ts
|
||
| if (!oldestMembership) { | ||
| // We are starting a call | ||
| params.append("intent", ElementCallIntent.StartCallDM); | ||
| } else if (oldestMembership.sender !== client.getSafeUserId()) { | ||
| // We are joining a call. | ||
| params.append("intent", ElementCallIntent.JoinExistingDM); | ||
| } // else, don't set an intent. | ||
| } | ||
| } | ||
|
|
||
| const rageshakeSubmitUrl = SdkConfig.get("bug_report_endpoint_url"); | ||
|
|
@@ -688,8 +704,8 @@ | |
| roomId, | ||
| {}, | ||
| { | ||
| skipLobby: skipLobby ?? false, | ||
| returnToLobby: returnToLobby ?? false, | ||
| skipLobby: skipLobby, | ||
| returnToLobby: returnToLobby, | ||
|
||
| }, | ||
| ), | ||
| }, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per convo, I think these should be undefined if unused.