You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-23 17:02:25 +03:00
MatrixRTC: Add RTC decline event (#4978)
* Add decline event Signed-off-by: Timo K <toger5@hotmail.de> * add `client.sendRtcDecline`. Signed-off-by: Timo K <toger5@hotmail.de> * remove `decline.reason` field. Signed-off-by: Timo K <toger5@hotmail.de> --------- Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
@@ -53,6 +53,7 @@ import {
|
|||||||
} from "../webrtc/callEventTypes.ts";
|
} from "../webrtc/callEventTypes.ts";
|
||||||
import {
|
import {
|
||||||
type IRTCNotificationContent,
|
type IRTCNotificationContent,
|
||||||
|
type IRTCDeclineContent,
|
||||||
type EncryptionKeysEventContent,
|
type EncryptionKeysEventContent,
|
||||||
type ICallNotifyContent,
|
type ICallNotifyContent,
|
||||||
} from "../matrixrtc/types.ts";
|
} from "../matrixrtc/types.ts";
|
||||||
@@ -152,6 +153,7 @@ export enum EventType {
|
|||||||
// MatrixRTC events
|
// MatrixRTC events
|
||||||
CallNotify = "org.matrix.msc4075.call.notify",
|
CallNotify = "org.matrix.msc4075.call.notify",
|
||||||
RTCNotification = "org.matrix.msc4075.rtc.notification",
|
RTCNotification = "org.matrix.msc4075.rtc.notification",
|
||||||
|
RTCDecline = "org.matrix.msc4310.rtc.decline",
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum RelationType {
|
export enum RelationType {
|
||||||
@@ -332,6 +334,7 @@ export interface TimelineEvents {
|
|||||||
[EventType.CallEncryptionKeysPrefix]: EncryptionKeysEventContent;
|
[EventType.CallEncryptionKeysPrefix]: EncryptionKeysEventContent;
|
||||||
[EventType.CallNotify]: ICallNotifyContent;
|
[EventType.CallNotify]: ICallNotifyContent;
|
||||||
[EventType.RTCNotification]: IRTCNotificationContent;
|
[EventType.RTCNotification]: IRTCNotificationContent;
|
||||||
|
[EventType.RTCDecline]: IRTCDeclineContent;
|
||||||
[M_BEACON.name]: MBeaconEventContent;
|
[M_BEACON.name]: MBeaconEventContent;
|
||||||
[M_POLL_START.name]: PollStartEventContent;
|
[M_POLL_START.name]: PollStartEventContent;
|
||||||
[M_POLL_END.name]: PollEndEventContent;
|
[M_POLL_END.name]: PollEndEventContent;
|
||||||
|
|||||||
@@ -3589,6 +3589,12 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
|
|||||||
return await this.setRoomReadMarkersHttpRequest(roomId, rmEventId, rrEventId, rpEventId);
|
return await this.setRoomReadMarkersHttpRequest(roomId, rmEventId, rrEventId, rpEventId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public sendRtcDecline(roomId: string, notificationEventId: string): Promise<ISendEventResponse> {
|
||||||
|
return this.sendEvent(roomId, EventType.RTCDecline, {
|
||||||
|
"m.relates_to": { event_id: notificationEventId, rel_type: RelationType.Reference },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a preview of the given URL as of (roughly) the given point in time,
|
* Get a preview of the given URL as of (roughly) the given point in time,
|
||||||
* described as an object with OpenGraph keys and associated values.
|
* described as an object with OpenGraph keys and associated values.
|
||||||
|
|||||||
@@ -104,6 +104,12 @@ export interface IRTCNotificationContent extends RelationEvent {
|
|||||||
"lifetime": number;
|
"lifetime": number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MSC4310 decline event content for `org.matrix.msc4310.rtc.decline`.
|
||||||
|
* Sent as a standard m.reference relation to an `org.matrix.msc4075.rtc.notification` event.
|
||||||
|
*/
|
||||||
|
export interface IRTCDeclineContent extends RelationEvent {}
|
||||||
|
|
||||||
export enum Status {
|
export enum Status {
|
||||||
Disconnected = "Disconnected",
|
Disconnected = "Disconnected",
|
||||||
Connecting = "Connecting",
|
Connecting = "Connecting",
|
||||||
|
|||||||
Reference in New Issue
Block a user