From 445b0a3a01baeb3c07d5eac8c8acaea4ae966b18 Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Sat, 10 Oct 2020 12:59:42 -0500 Subject: [PATCH 1/4] Clarify m.room.redaction, remove duplicate entry Signed-off-by: Aaron Raimist --- event-schemas/schema/m.room.redaction | 2 +- specification/client_server_api.rst | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/event-schemas/schema/m.room.redaction b/event-schemas/schema/m.room.redaction index b3bc418e..f2c10fd5 100644 --- a/event-schemas/schema/m.room.redaction +++ b/event-schemas/schema/m.room.redaction @@ -1,7 +1,7 @@ --- allOf: - $ref: core-event-schema/room_event.yaml -description: 'Events can be redacted by either room or server admins. Redacting an event means that all keys not required by the protocol are stripped off, allowing admins to remove offensive or illegal content that may have been attached to any event. This cannot be undone, allowing server owners to physically delete the offending data. There is also a concept of a moderator hiding a message event, which can be undone, but cannot be applied to state events. The event that has been redacted is specified in the ``redacts`` event level key.' +description: 'Redacting an event means that all keys not required by the protocol are stripped off, allowing messages to be hidden or allowing admins to remove offensive or illegal content. Users may redact their own events, and any user with a power level greater than or equal to the redact power level of the room may redact events in that room. Redactions cannot be undone. The event that has been redacted is specified in the ``redacts`` event level key.' properties: content: properties: diff --git a/specification/client_server_api.rst b/specification/client_server_api.rst index 4847d837..a1f48910 100644 --- a/specification/client_server_api.rst +++ b/specification/client_server_api.rst @@ -1551,8 +1551,6 @@ prefixed with ``m.`` {{m_room_power_levels_event}} -{{m_room_redaction_event}} - Historical events +++++++++++++++++ From 206b4dfb293e70e75e0def16945513505fc84087 Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Sat, 10 Oct 2020 13:10:46 -0500 Subject: [PATCH 2/4] Add changelog Signed-off-by: Aaron Raimist --- changelogs/client_server/newsfragments/2814.clarification | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/client_server/newsfragments/2814.clarification diff --git a/changelogs/client_server/newsfragments/2814.clarification b/changelogs/client_server/newsfragments/2814.clarification new file mode 100644 index 00000000..840300fe --- /dev/null +++ b/changelogs/client_server/newsfragments/2814.clarification @@ -0,0 +1 @@ +Clarify description of m.room.redaction event. From 4414d44f34e9cb7374e49a67d485d706ab990720 Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Mon, 12 Oct 2020 22:30:49 -0500 Subject: [PATCH 3/4] Remove duplicate description of who can redact a message and correct that description Signed-off-by: Aaron Raimist --- api/client-server/redaction.yaml | 6 +++--- event-schemas/schema/m.room.redaction | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/client-server/redaction.yaml b/api/client-server/redaction.yaml index 811773d6..52ff3064 100644 --- a/api/client-server/redaction.yaml +++ b/api/client-server/redaction.yaml @@ -36,9 +36,9 @@ paths: This cannot be undone. - Users may redact their own events, and any user with a power level - greater than or equal to the ``redact`` power level of the room may - redact events there. + Any user with a power level greater than or equal to the ``redact`` power level + of the room may redact events there. Additionally, server administrators may + redact messages sent by their server. operationId: redactEvent security: - accessToken: [] diff --git a/event-schemas/schema/m.room.redaction b/event-schemas/schema/m.room.redaction index f2c10fd5..b66c540c 100644 --- a/event-schemas/schema/m.room.redaction +++ b/event-schemas/schema/m.room.redaction @@ -1,7 +1,7 @@ --- allOf: - $ref: core-event-schema/room_event.yaml -description: 'Redacting an event means that all keys not required by the protocol are stripped off, allowing messages to be hidden or allowing admins to remove offensive or illegal content. Users may redact their own events, and any user with a power level greater than or equal to the redact power level of the room may redact events in that room. Redactions cannot be undone. The event that has been redacted is specified in the ``redacts`` event level key.' +description: 'This event is created by the server to describe which event has been redacted, by whom, and optionally why. The event that has been redacted is specified in the ``redacts`` event level key. Redacting an event means that all keys not required by the protocol are stripped off, allowing messages to be hidden or allowing admins to remove offensive or illegal content.' properties: content: properties: From a82b657a0a9251f130b23feda588ecbc03f6c89c Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Wed, 14 Oct 2020 22:44:13 -0500 Subject: [PATCH 4/4] Attempt to differentiate between m.room.redaction event PL and redact PL Signed-off-by: Aaron Raimist --- api/client-server/redaction.yaml | 9 ++++++--- event-schemas/schema/m.room.power_levels | 11 ++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/api/client-server/redaction.yaml b/api/client-server/redaction.yaml index 52ff3064..1dbdf76e 100644 --- a/api/client-server/redaction.yaml +++ b/api/client-server/redaction.yaml @@ -36,9 +36,12 @@ paths: This cannot be undone. - Any user with a power level greater than or equal to the ``redact`` power level - of the room may redact events there. Additionally, server administrators may - redact messages sent by their server. + Any user with a power level greater than or equal to the ``m.room.redaction`` + event power level may send redaction events in the room. If the user's power + level greater is also greater than or equal to the ``redact`` power level + of the room, the user may redact events sent by other users. + + Server administrators may redact events sent by users on their server. operationId: redactEvent security: - accessToken: [] diff --git a/event-schemas/schema/m.room.power_levels b/event-schemas/schema/m.room.power_levels index 06f55d26..8e94bcc0 100644 --- a/event-schemas/schema/m.room.power_levels +++ b/event-schemas/schema/m.room.power_levels @@ -25,10 +25,11 @@ description: |- ``events_default`` are 0. The power level required to invite a user to the room, kick a user from the - room, ban a user from the room, or redact an event, is defined by ``invite``, - ``kick``, ``ban``, and ``redact``, respectively. Each of these levels defaults - to 50 if they are not specified in the ``m.room.power_levels`` event, or if - the room contains no ``m.room.power_levels`` event. + room, ban a user from the room, or redact an event sent by another user, is + defined by ``invite``, ``kick``, ``ban``, and ``redact``, respectively. Each + of these levels defaults to 50 if they are not specified in the + ``m.room.power_levels`` event, or if the room contains no ``m.room.power_levels`` + event. .. NOTE:: @@ -65,7 +66,7 @@ properties: description: The level required to kick a user. Defaults to 50 if unspecified. type: integer redact: - description: The level required to redact an event. Defaults to 50 if unspecified. + description: The level required to redact an event sent by another user. Defaults to 50 if unspecified. type: integer state_default: description: |-