Apply suggestions from code review

Co-authored-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
Andrew Morgan 2023-08-04 10:13:54 +01:00 committed by GitHub
parent 8f4d9c9784
commit 6189837faf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 8 deletions

View file

@ -1 +1 @@
Event reporters must be able to view the event in order to report it. [MSC2249](https://github.com/matrix-org/matrix-spec-proposals/pull/2249). Require callers to be joined to the room to report its events, as per [MSC2249](https://github.com/matrix-org/matrix-spec-proposals/pull/2249).

View file

@ -29,16 +29,22 @@ securityDefinitions:
paths: paths:
"/rooms/{roomId}/report/{eventId}": "/rooms/{roomId}/report/{eventId}":
post: post:
summary: Reports an event as inappropriate. You must be joined to the room in order summary: Report an event in a joined room as inappropriate.
to report an event.
description: |- description: |-
Reports an event as inappropriate to the server, which may then notify Reports an event as inappropriate to the server, which may then notify
the appropriate people. the appropriate people. The caller must be joined to the room to report
it.
It may be possible for clients to deduce whether an event exists by It can be possible for clients to deduce whether an event exists by
timing the response, as only a report for an event that does exist timing the response, as only a report for an event that does exist
will require the homeserver to check whether a user is joined to will require the homeserver to check whether a user is joined to
the room. To combat this, homeserver implementations may add the room. To combat this, homeserver implementations are encouraged
to add a random delay when generating the response.
It might be possible for clients to deduce whether an event exists by
timing the response, as only a report for an event that does exist
will require the homeserver to check whether a user is joined to
the room. To combat this, homeserver implementations should add
a random delay when generating a response. a random delay when generating a response.
operationId: reportContent operationId: reportContent
tags: tags:
@ -88,14 +94,18 @@ paths:
application/json: {} application/json: {}
404: 404:
description: |- description: |-
The event was not found or you do not have permission to read this event. The event was not found or you are not joined to the room where the
event resides.
Homeserver implementations can additionally return this error if the
reported event has been redacted.
Homeserver implementations may additionally return this error if the Homeserver implementations may additionally return this error if the
reported event has been redacted. reported event has been redacted.
examples: examples:
application/json: { application/json: {
"errcode": "M_NOT_FOUND", "errcode": "M_NOT_FOUND",
"error": "The event was not found or you do not have permission to read this event." "error": "The event was not found or you are not joined to the room."
} }
schema: schema:
$ref: "../client-server/definitions/errors/error.yaml" $ref: "../client-server/definitions/errors/error.yaml"