Skip to content

Commit c74105d

Browse files
authored
MSC4151: Reporting rooms (#1938)
1 parent e972e29 commit c74105d

File tree

4 files changed

+82
-8
lines changed

4 files changed

+82
-8
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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).
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add `POST /_matrix/client/v3/rooms/{roomId}/report` as per [MSC4151](https://github.com/matrix-org/matrix-spec-proposals/pull/4151).

content/client-server-api/modules/report_content.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ Users may encounter content which they find inappropriate and should be
55
able to report it to the server administrators or room moderators for
66
review. This module defines a way for users to report content.
77

8-
Content is reported based upon a negative score, where -100 is "most
9-
offensive" and 0 is "inoffensive".
10-
118
#### Client behaviour
129

1310
{{% http-api spec="client-server" api="report_content" %}}
@@ -19,6 +16,16 @@ This may be a dedicated room to alert server administrators to the
1916
reported content or some other mechanism for notifying the appropriate
2017
people.
2118

22-
{{< changed-in v="1.8" >}} The server MUST verify that the user
23-
reporting the event is currently joined to the room the event is
24-
in before accepting a report.
19+
Particularly during waves of harmful content, users may report whole
20+
rooms instead of individual events. Server administrators and safety teams
21+
should, therefore, be cautious not to shut down rooms that might otherwise
22+
be legitimate.
23+
24+
{{< changed-in v="1.8" >}} When processing event reports, servers MUST
25+
verify that the reporting user is currently joined to the room the event
26+
is in before accepting a report.
27+
28+
{{< added-in v="1.12" >}} Contrarily, servers MUST NOT restrict room reports
29+
based on whether or not the reporting user is joined to the room. This is
30+
because users can be exposed to harmful content without being joined to a
31+
room. For instance, through room directories or invites.

data/api/client-server/report_content.yaml

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,71 @@ info:
1616
title: Matrix Client-Server Report Content API
1717
version: 1.0.0
1818
paths:
19+
"/rooms/{roomId}/report":
20+
post:
21+
x-addedInMatrixVersion: "1.12"
22+
summary: Report a room as inappropriate.
23+
description: |-
24+
Reports a room as inappropriate to the server, which may then notify
25+
the appropriate people. How such information is delivered is left up to
26+
implementations. The caller is not required to be joined to the room to
27+
report it.
28+
operationId: reportRoom
29+
parameters:
30+
- in: path
31+
name: roomId
32+
description: The room being reported.
33+
required: true
34+
example: "!637q39766251:example.com"
35+
schema:
36+
type: string
37+
requestBody:
38+
content:
39+
application/json:
40+
schema:
41+
type: object
42+
example: {
43+
"reason": "this makes me sad"
44+
}
45+
properties:
46+
reason:
47+
type: string
48+
description: The reason the room is being reported.
49+
required: true
50+
security:
51+
- accessTokenQuery: []
52+
- accessTokenBearer: []
53+
responses:
54+
"200":
55+
description: The room has been reported successfully.
56+
content:
57+
application/json:
58+
schema:
59+
type: object
60+
examples:
61+
response:
62+
value: {}
63+
"404":
64+
description: |-
65+
The room was not found on the homeserver.
66+
content:
67+
application/json:
68+
schema:
69+
$ref: definitions/errors/error.yaml
70+
examples:
71+
response:
72+
value: {
73+
"errcode": "M_NOT_FOUND",
74+
"error": "The room was not found."
75+
}
76+
"429":
77+
description: This request was rate-limited.
78+
content:
79+
application/json:
80+
schema:
81+
$ref: definitions/errors/rate_limited.yaml
82+
tags:
83+
- Reporting content
1984
"/rooms/{roomId}/report/{eventId}":
2085
post:
2186
summary: Report an event in a joined room as inappropriate.
@@ -29,7 +94,7 @@ paths:
2994
will require the homeserver to check whether a user is joined to
3095
the room. To combat this, homeserver implementations should add
3196
a random delay when generating a response.
32-
operationId: reportContent
97+
operationId: reportEvent
3398
parameters:
3499
- in: path
35100
name: roomId
@@ -62,7 +127,7 @@ paths:
62127
and 0 is inoffensive.
63128
reason:
64129
type: string
65-
description: The reason the content is being reported. May be blank.
130+
description: The reason the content is being reported.
66131
required: true
67132
security:
68133
- accessTokenQuery: []

0 commit comments

Comments
 (0)