You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-25 05:23:13 +03:00
Allow sending notification events when starting a call (#4826)
* Make it easier to mock call memberships for specific user IDs * Allow sending notification events when starting a call * rename notify -> notification * replace `joining` concept with `ownMembership` * introduce new `m.rtc.notification` event alongside `m.call.notify` * send new notification event alongside the deprecated one * Test for new notification event type * update relation string to match msc * review * fix doc errors * fix tests + format * remove anything decline related --------- Co-authored-by: Timo <toger5@hotmail.de>
This commit is contained in:
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
import type { IMentions } from "../matrix.ts";
|
||||
import type { RelationEvent } from "../types.ts";
|
||||
import type { CallMembership } from "./CallMembership.ts";
|
||||
|
||||
export type ParticipantId = string;
|
||||
@@ -80,9 +81,13 @@ export interface EncryptionKeysToDeviceEventContent {
|
||||
// Why is this needed?
|
||||
sent_ts?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use `RTCNotificationType` instead.
|
||||
*/
|
||||
export type CallNotifyType = "ring" | "notify";
|
||||
|
||||
/**
|
||||
* @deprecated Use `IRTCNotificationContent` instead.
|
||||
*/
|
||||
export interface ICallNotifyContent {
|
||||
"application": string;
|
||||
"m.mentions": IMentions;
|
||||
@@ -90,6 +95,15 @@ export interface ICallNotifyContent {
|
||||
"call_id": string;
|
||||
}
|
||||
|
||||
export type RTCNotificationType = "ring" | "notification";
|
||||
export interface IRTCNotificationContent extends RelationEvent {
|
||||
"m.mentions": IMentions;
|
||||
"decline_reason"?: string;
|
||||
"notification_type": RTCNotificationType;
|
||||
"sender_ts": number;
|
||||
"lifetime": number;
|
||||
}
|
||||
|
||||
export enum Status {
|
||||
Disconnected = "Disconnected",
|
||||
Connecting = "Connecting",
|
||||
|
||||
Reference in New Issue
Block a user