mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 12:44:58 -04:00
Do not allow cross-room relations, per MSC2674. (#11516)
This commit is contained in:
parent
0cc3bf97b4
commit
3b8872299a
6 changed files with 161 additions and 17 deletions
|
@ -212,6 +212,7 @@ class RelationPaginationServlet(RestServlet):
|
|||
|
||||
pagination_chunk = await self.store.get_relations_for_event(
|
||||
event_id=parent_id,
|
||||
room_id=room_id,
|
||||
relation_type=relation_type,
|
||||
event_type=event_type,
|
||||
limit=limit,
|
||||
|
@ -317,6 +318,7 @@ class RelationAggregationPaginationServlet(RestServlet):
|
|||
|
||||
pagination_chunk = await self.store.get_aggregation_groups_for_event(
|
||||
event_id=parent_id,
|
||||
room_id=room_id,
|
||||
event_type=event_type,
|
||||
limit=limit,
|
||||
from_token=from_token,
|
||||
|
@ -383,7 +385,9 @@ class RelationAggregationGroupPaginationServlet(RestServlet):
|
|||
|
||||
# This checks that a) the event exists and b) the user is allowed to
|
||||
# view it.
|
||||
await self.event_handler.get_event(requester.user, room_id, parent_id)
|
||||
event = await self.event_handler.get_event(requester.user, room_id, parent_id)
|
||||
if event is None:
|
||||
raise SynapseError(404, "Unknown parent event.")
|
||||
|
||||
if relation_type != RelationTypes.ANNOTATION:
|
||||
raise SynapseError(400, "Relation type must be 'annotation'")
|
||||
|
@ -402,6 +406,7 @@ class RelationAggregationGroupPaginationServlet(RestServlet):
|
|||
|
||||
result = await self.store.get_relations_for_event(
|
||||
event_id=parent_id,
|
||||
room_id=room_id,
|
||||
relation_type=relation_type,
|
||||
event_type=event_type,
|
||||
aggregation_key=key,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue