-
-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MSC4151: Reporting rooms #1938
base: main
Are you sure you want to change the base?
MSC4151: Reporting rooms #1938
Changes from all commits
fb71935
ab88044
9d63f31
1cf5104
3aad778
414001a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
The `reason` parameter in `POST /_matrix/client/v3/rooms/{roomId}/report/{eventId}` can be omitted instead of left blank as per [MSC2414](https://github.com/matrix-org/matrix-spec-proposals/pull/2414). |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add `POST /_matrix/client/v3/rooms/{roomId}/report` as per [MSC4151](https://github.com/matrix-org/matrix-spec-proposals/pull/4151). |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,70 @@ info: | |
title: Matrix Client-Server Report Content API | ||
version: 1.0.0 | ||
paths: | ||
"/rooms/{roomId}/report": | ||
post: | ||
x-addedInMatrixVersion: "1.12" | ||
summary: Report a room as inappropriate. | ||
description: |- | ||
Reports a room as inappropriate to the server, which may then notify | ||
the appropriate people. The caller is not required to be joined to the | ||
room to report it. | ||
operationId: reportRoom | ||
parameters: | ||
- in: path | ||
name: roomId | ||
description: The room being reported. | ||
required: true | ||
example: "!637q39766251:example.com" | ||
schema: | ||
type: string | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
example: { | ||
"reason": "this makes me sad" | ||
} | ||
properties: | ||
reason: | ||
type: string | ||
description: The reason the room is being reported. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
required: true | ||
security: | ||
- accessTokenQuery: [] | ||
- accessTokenBearer: [] | ||
responses: | ||
"200": | ||
description: The room has been reported successfully. | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
examples: | ||
response: | ||
value: {} | ||
"404": | ||
description: |- | ||
The room was not found on the homeserver. | ||
content: | ||
application/json: | ||
schema: | ||
$ref: definitions/errors/error.yaml | ||
examples: | ||
response: | ||
value: { | ||
"errcode": "M_NOT_FOUND", | ||
"error": "The room was not found." | ||
} | ||
"429": | ||
description: This request was rate-limited. | ||
content: | ||
application/json: | ||
schema: | ||
$ref: definitions/errors/rate_limited.yaml | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if this is technically correct since the MSC strongly recommends but doesn't require rate limiting. |
||
tags: | ||
- Reporting content | ||
"/rooms/{roomId}/report/{eventId}": | ||
post: | ||
summary: Report an event in a joined room as inappropriate. | ||
|
@@ -29,7 +93,7 @@ paths: | |
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. | ||
operationId: reportContent | ||
operationId: reportEvent | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm unsure what consequences changing this has but the old ID felt unsuitable now that there are two endpoints in the module. |
||
parameters: | ||
- in: path | ||
name: roomId | ||
|
@@ -62,7 +126,7 @@ paths: | |
and 0 is inoffensive. | ||
reason: | ||
type: string | ||
description: The reason the content is being reported. May be blank. | ||
description: The reason the content is being reported. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have removed this as proposed in MSC2414 and thought it aligns well enough with the rest of this pull request to sneak in. 😇 |
||
required: true | ||
security: | ||
- accessTokenQuery: [] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this here because it only applies to event reporting and is repeated in the corresponding endpoint's documentation.