@@ -111,8 +111,8 @@ export type RTCCallIntent = "audio" | "video" | string;
111
111
* @returns a parsed IRTCNotificationContent
112
112
*/
113
113
export function parseCallNotificationContent ( content : IContent ) : IRTCNotificationContent {
114
- if ( typeof content [ "m.mentions" ] !== "object" ) {
115
- throw new Error ( "Missing m.mentions" ) ;
114
+ if ( content [ "m.mentions" ] && typeof content [ "m.mentions" ] !== "object" ) {
115
+ throw new Error ( "malformed m.mentions" ) ;
116
116
}
117
117
if ( typeof content [ "notification_type" ] !== "string" ) {
118
118
throw new Error ( "Missing or invalid notification_type" ) ;
@@ -124,9 +124,6 @@ export function parseCallNotificationContent(content: IContent): IRTCNotificatio
124
124
throw new Error ( "Missing or invalid lifetime" ) ;
125
125
}
126
126
127
- if ( content [ "decline_reason" ] && typeof content [ "decline_reason" ] !== "string" ) {
128
- throw new Error ( "Invalid decline_reason" ) ;
129
- }
130
127
if ( content [ "relation" ] && content [ "relation" ] [ "rel_type" ] !== "m.reference" ) {
131
128
throw new Error ( "Invalid relation" ) ;
132
129
}
@@ -143,8 +140,7 @@ export function parseCallNotificationContent(content: IContent): IRTCNotificatio
143
140
* Don't cast event content to this directly. Use `parseCallNotificationContent` instead to validate the content first.
144
141
*/
145
142
export interface IRTCNotificationContent extends RelationEvent {
146
- "m.mentions" : IMentions ;
147
- "decline_reason" ?: string ;
143
+ "m.mentions" ?: IMentions ;
148
144
"notification_type" : RTCNotificationType ;
149
145
/**
150
146
* The initial intent of the calling user.
0 commit comments