From cade909e25b24cf5805318335d33150af2794c67 Mon Sep 17 00:00:00 2001 From: Benjamin Saunders Date: Fri, 26 Aug 2016 22:59:23 -0700 Subject: [PATCH] Fix inconsistencies regarding redacted_because Signed-off-by: Benjamin Saunders --- api/client-server/definitions/event.yaml | 4 ++++ changelogs/client_server.rst | 2 ++ event-schemas/examples/m.room.redaction | 4 +++- event-schemas/schema/core-event-schema/room_event.yaml | 5 +++-- specification/client_server_api.rst | 7 ++++--- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/api/client-server/definitions/event.yaml b/api/client-server/definitions/event.yaml index aeda2739..aa893fd4 100644 --- a/api/client-server/definitions/event.yaml +++ b/api/client-server/definitions/event.yaml @@ -52,6 +52,10 @@ properties: This key will only be present for message events sent by the device calling this API. type: string + redacted_because: + description: Optional. The event that redacted this event, if any. + title: Event + type: object title: Unsigned type: object title: Event diff --git a/changelogs/client_server.rst b/changelogs/client_server.rst index f5cf318d..d7384e31 100644 --- a/changelogs/client_server.rst +++ b/changelogs/client_server.rst @@ -21,6 +21,8 @@ (`#371 `_). - Correct references to ``user_id`` which should have been ``sender`` (`#376 `_). + - Correct inconsistent specification of ``redacted_because`` fields and their + values (`#378 `_). - Changes to the API which will be backwards-compatible for clients: diff --git a/event-schemas/examples/m.room.redaction b/event-schemas/examples/m.room.redaction index 5f4aae1e..46df2ab4 100644 --- a/event-schemas/examples/m.room.redaction +++ b/event-schemas/examples/m.room.redaction @@ -1,5 +1,7 @@ { - "age": 242352, + "unsigned": { + "age": 242352 + }, "content": { "reason": "Spamming" }, diff --git a/event-schemas/schema/core-event-schema/room_event.yaml b/event-schemas/schema/core-event-schema/room_event.yaml index 33e7532d..06b7b496 100644 --- a/event-schemas/schema/core-event-schema/room_event.yaml +++ b/event-schemas/schema/core-event-schema/room_event.yaml @@ -25,8 +25,9 @@ properties: sent type: integer redacted_because: - description: The reason this event was redacted, if it was redacted - type: string + description: Optional. The event that redacted this event, if any. + title: Event + type: object transaction_id: description: The client-supplied transaction ID, if the client being given the event is the same one which sent it. diff --git a/specification/client_server_api.rst b/specification/client_server_api.rst index b20ca9f2..a74129b5 100644 --- a/specification/client_server_api.rst +++ b/specification/client_server_api.rst @@ -970,9 +970,10 @@ one of the following event types: ``kick``, ``redact``, ``state_default``, ``users``, ``users_default``. - ``m.room.aliases`` allows key ``aliases`` -The redaction event should be added under the key ``redacted_because``. When a -client receives a redaction event it should change the redacted event -in the same way a server does. +The server should add the event causing the redaction to the ``unsigned`` +property of the redacted event, under the ``redacted_because`` key. When a +client receives a redaction event it should change the redacted event in the +same way a server does. Events ++++++