From ffa0a6f13b1b87b02c1712261c8dcf2841fb735b Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 17 May 2023 14:43:18 +0100 Subject: [PATCH] Move common voip events to the content, not the actual event --- .../schema/core-event-schema/call_event.yaml | 8 +++----- data/event-schemas/schema/m.call.answer.yaml | 5 ++++- data/event-schemas/schema/m.call.candidates.yaml | 5 ++++- data/event-schemas/schema/m.call.hangup.yaml | 4 +++- data/event-schemas/schema/m.call.invite.yaml | 5 ++++- data/event-schemas/schema/m.call.negotiate.yaml | 4 +++- data/event-schemas/schema/m.call.reject.yaml | 4 +++- data/event-schemas/schema/m.call.select_answer.yaml | 5 ++++- 8 files changed, 28 insertions(+), 12 deletions(-) diff --git a/data/event-schemas/schema/core-event-schema/call_event.yaml b/data/event-schemas/schema/core-event-schema/call_event.yaml index 4fcb833d..c089e0ad 100644 --- a/data/event-schemas/schema/core-event-schema/call_event.yaml +++ b/data/event-schemas/schema/core-event-schema/call_event.yaml @@ -1,7 +1,5 @@ -allOf: -- "$ref": room_event.yaml - description: "All call events share a set of common fields: those of room events - and some additional VoIP specific fields." +description: "The content of all call events shares a set of common fields: those + of room events and some additional VoIP specific fields." properties: call_id: type: string @@ -17,7 +15,7 @@ properties: type: string description: 'This identifies the party that sent this event. A client may choose to re-use the device ID from end-to-end cryptography for the value - of this field. ' + of this field.' required: - call_id - version diff --git a/data/event-schemas/schema/m.call.answer.yaml b/data/event-schemas/schema/m.call.answer.yaml index 58accd9d..163690be 100644 --- a/data/event-schemas/schema/m.call.answer.yaml +++ b/data/event-schemas/schema/m.call.answer.yaml @@ -2,11 +2,14 @@ "type": "object", "description": "This event is sent by the callee when they wish to answer the call.", "allOf": [{ - "$ref": "core-event-schema/call_event.yaml" + "$ref": "core-event-schema/room_event.yaml" }], "properties": { "content": { "type": "object", + "allOf": [{ + "$ref": "core-event-schema/call_event.yaml" + }], "properties": { "answer": { "type": "object", diff --git a/data/event-schemas/schema/m.call.candidates.yaml b/data/event-schemas/schema/m.call.candidates.yaml index 4412dd1c..6aa16229 100644 --- a/data/event-schemas/schema/m.call.candidates.yaml +++ b/data/event-schemas/schema/m.call.candidates.yaml @@ -2,11 +2,14 @@ "type": "object", "description": "This event is sent by callers after sending an invite and by the callee after answering. Its purpose is to give the other party additional ICE candidates to try using to communicate.", "allOf": [{ - "$ref": "core-event-schema/call_event.yaml" + "$ref": "core-event-schema/room_event.yaml" }], "properties": { "content": { "type": "object", + "allOf": [{ + "$ref": "core-event-schema/call_event.yaml" + }], "properties": { "candidates": { "type": "array", diff --git a/data/event-schemas/schema/m.call.hangup.yaml b/data/event-schemas/schema/m.call.hangup.yaml index 25e7b153..480ce419 100644 --- a/data/event-schemas/schema/m.call.hangup.yaml +++ b/data/event-schemas/schema/m.call.hangup.yaml @@ -22,10 +22,12 @@ description: | * `unknown_error`: Some other failure occurred that meant the client was unable to continue the call rather than the user choosing to end it. allOf: -- "$ref": core-event-schema/call_event.yaml +- "$ref": core-event-schema/room_event.yaml properties: content: type: object + allOf: + - "$ref": core-event-schema/call_event.yaml properties: reason: type: string diff --git a/data/event-schemas/schema/m.call.invite.yaml b/data/event-schemas/schema/m.call.invite.yaml index 07dc5aff..5ab1cee4 100644 --- a/data/event-schemas/schema/m.call.invite.yaml +++ b/data/event-schemas/schema/m.call.invite.yaml @@ -2,11 +2,14 @@ "type": "object", "description": "This event is sent by the caller when they wish to establish a call.", "allOf": [{ - "$ref": "core-event-schema/call_event.yaml" + "$ref": "core-event-schema/room_event.yaml" }], "properties": { "content": { "type": "object", + "allOf": [{ + "$ref": "core-event-schema/call_event.yaml" + }], "properties": { "offer": { "type": "object", diff --git a/data/event-schemas/schema/m.call.negotiate.yaml b/data/event-schemas/schema/m.call.negotiate.yaml index 14efcbe2..631ac238 100644 --- a/data/event-schemas/schema/m.call.negotiate.yaml +++ b/data/event-schemas/schema/m.call.negotiate.yaml @@ -34,10 +34,12 @@ description: | attempt to validate the `type` field, but simply pass the object into the WebRTC API. allOf: -- "$ref": core-event-schema/call_event.yaml +- "$ref": core-event-schema/room_event.yaml properties: content: type: object + allOf: + - "$ref": core-event-schema/call_event.yaml properties: offer: type: object diff --git a/data/event-schemas/schema/m.call.reject.yaml b/data/event-schemas/schema/m.call.reject.yaml index bd745132..695cabbf 100644 --- a/data/event-schemas/schema/m.call.reject.yaml +++ b/data/event-schemas/schema/m.call.reject.yaml @@ -13,10 +13,12 @@ description: | The meanings of the `reason` codes are the same as in [`m.call.hangup`](#mcallhangup). allOf: -- "$ref": core-event-schema/call_event.yaml +- "$ref": core-event-schema/room_event.yaml properties: content: type: object + allOf: + - "$ref": core-event-schema/call_event.yaml properties: reason: type: string diff --git a/data/event-schemas/schema/m.call.select_answer.yaml b/data/event-schemas/schema/m.call.select_answer.yaml index 8a9b6877..774d02ea 100644 --- a/data/event-schemas/schema/m.call.select_answer.yaml +++ b/data/event-schemas/schema/m.call.select_answer.yaml @@ -2,11 +2,14 @@ "type": "object", "description": "This event is sent by the caller's client once it has decided which other client to talk to, by selecting one of multiple possible incoming `m.call.answer` events. Its `selected_party_id` field indicates the answer it's chosen. The `call_id` and `party_id` of the caller is also included. If the callee's client sees a `select_answer` for an answer with party ID other than the one it sent, it ends the call and informs the user the call was answered elsewhere. It does not send any events. Media can start flowing before this event is seen or even sent. Clients that implement previous versions of this specification will ignore this event and behave as they did before.", "allOf": [{ - "$ref": "core-event-schema/call_event.yaml" + "$ref": "core-event-schema/room_event.yaml" }], "properties": { "content": { "type": "object", + "allOf": [{ + "$ref": "core-event-schema/call_event.yaml" + }], "properties": { "selected_party_id": { "type": "string",