-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
MSC4151: Reporting rooms #1938
Changes from all commits
fb71935
ab88044
9d63f31
1cf5104
3aad778
414001a
8c8c37d
00d4e6d
883e9e3
c2b90d5
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,71 @@ 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. How such information is delivered is left up to | ||||||
implementations. 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. 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. Given the event reporting endpoint already has the parameters marked as optional, and MSC2414 was trying to match that endpoint, making them optional here too looks like the right thing to me. |
||||||
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 | ||||||
Johennes marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
tags: | ||||||
- Reporting content | ||||||
"/rooms/{roomId}/report/{eventId}": | ||||||
post: | ||||||
summary: Report an event in a joined room as inappropriate. | ||||||
|
@@ -29,7 +94,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. 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. Looks like it's used to generate bindings, and as such we probably shouldn't change it... matrix-spec/meta/documentation_style.rst Lines 113 to 114 in 2cbf606
@turt2live curious if you happen to know more about this? 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 suppose if we want to be safe, keeping 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. Indeed, 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. We concluded in #matrix-docs:matrix.org that changing the operation ID is not ideal but acceptable in this case as otherwise it'll be even harder to fix in future. |
||||||
parameters: | ||||||
- in: path | ||||||
name: roomId | ||||||
|
@@ -62,7 +127,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.