diff --git a/data/event-schemas/schema/components/room_key_withheld_content.yaml b/data/event-schemas/schema/components/room_key_withheld_content.yaml new file mode 100644 index 00000000..9c8b957b --- /dev/null +++ b/data/event-schemas/schema/components/room_key_withheld_content.yaml @@ -0,0 +1,45 @@ +type: object +properties: + algorithm: + type: string + enum: ["m.megolm.v1.aes-sha2"] + description: |- + The encryption algorithm for the key that this event is about. + room_id: + type: string + description: |- + Required if `code` is not `m.no_olm`. The room for the key that + this event is about. + session_id: + type: string + description: |- + Required if `code` is not `m.no_olm`. The session ID of the key + that this event is about. + sender_key: + type: string + description: |- + The unpadded base64-encoded device curve25519 key of the event\'s + sender. + code: + type: string + enum: + - m.blacklisted + - m.unverified + - m.unauthorised + - m.unavailable + - m.no_olm + description: |- + A machine-readable code for why the key was not sent. Codes beginning + with `m.` are reserved for codes defined in the Matrix + specification. Custom codes must use the Java package naming + convention. + reason: + type: string + description: |- + A human-readable reason for why the key was not sent. The receiving + client should only use this string if it does not understand the + `code`. +required: + - algorithm + - sender_key + - code diff --git a/data/event-schemas/schema/m.room_key.withheld.yaml b/data/event-schemas/schema/m.room_key.withheld.yaml index 185aa902..9371578d 100644 --- a/data/event-schemas/schema/m.room_key.withheld.yaml +++ b/data/event-schemas/schema/m.room_key.withheld.yaml @@ -36,51 +36,7 @@ description: |- room messages sent before it receives the message. properties: content: - properties: - algorithm: - type: string - enum: ["m.megolm.v1.aes-sha2"] - description: |- - The encryption algorithm for the key that this event is about. - room_id: - type: string - description: |- - Required if `code` is not `m.no_olm`. The room for the key that - this event is about. - session_id: - type: string - description: |- - Required if `code` is not `m.no_olm`. The session ID of the key - that this event is about. - sender_key: - type: string - description: |- - The unpadded base64-encoded device curve25519 key of the event\'s - sender. - code: - type: string - enum: - - m.blacklisted - - m.unverified - - m.unauthorised - - m.unavailable - - m.no_olm - description: |- - A machine-readable code for why the key was not sent. Codes beginning - with `m.` are reserved for codes defined in the Matrix - specification. Custom codes must use the Java package naming - convention. - reason: - type: string - description: |- - A human-readable reason for why the key was not sent. The receiving - client should only use this string if it does not understand the - `code`. - required: - - algorithm - - sender_key - - code - type: object + $ref: "components/room_key_withheld_content.yaml" type: enum: - m.room_key.withheld