Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Implement MSC2414: Make reason and score parameters optional for reporting content #8551

@anoadragon453

Description

@anoadragon453

MSC2414 made the reason and score parameters for the POST /_matrix/client/r0/rooms/{roomId}/report/{eventId} endpoint.

That endpoint is implemented in Synapse here:

class ReportEventRestServlet(RestServlet):
PATTERNS = client_patterns("/rooms/(?P<room_id>[^/]*)/report/(?P<event_id>[^/]*)$")
def __init__(self, hs):
super().__init__()
self.hs = hs
self.auth = hs.get_auth()
self.clock = hs.get_clock()
self.store = hs.get_datastore()
async def on_POST(self, request, room_id, event_id):
requester = await self.auth.get_user_by_req(request)
user_id = requester.user.to_string()
body = parse_json_object_from_request(request)
assert_params_in_dict(body, ("reason", "score"))

The Event Reports Admin API should also be updated to state that the reason and content fields may be both blank and null, and the Admin API endpoint should be updated to expect None values for these keys as well:

er.reason,
er.content,

(that function may not actually need updating, but it would be good to check that the API still behaves as expected).

Some tests for clients sending reports without reason and score would be great as well.

This will need to be implemented in order to eventually advertise support for the next Client-Server API version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-Spec-Complianceplaces where synapse does not conform to the specT-EnhancementNew features, changes in functionality, improvements in performance, or user-facing enhancements.good first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions