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

Commit

Permalink
Remove unused argument for get_relations_for_event. (#13383)
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Jul 26, 2022
1 parent 549c556 commit 8b60329
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 9 deletions.
1 change: 1 addition & 0 deletions changelog.d/13383.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove an unused argument to `get_relations_for_event`.
3 changes: 0 additions & 3 deletions synapse/handlers/relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ async def get_relations(
room_id: str,
relation_type: Optional[str] = None,
event_type: Optional[str] = None,
aggregation_key: Optional[str] = None,
limit: int = 5,
direction: str = "b",
from_token: Optional[StreamToken] = None,
Expand All @@ -89,7 +88,6 @@ async def get_relations(
room_id: The room the event belongs to.
relation_type: Only fetch events with this relation type, if given.
event_type: Only fetch events with this event type, if given.
aggregation_key: Only fetch events with this aggregation key, if given.
limit: Only fetch the most recent `limit` events.
direction: Whether to fetch the most recent first (`"b"`) or the
oldest first (`"f"`).
Expand Down Expand Up @@ -122,7 +120,6 @@ async def get_relations(
room_id=room_id,
relation_type=relation_type,
event_type=event_type,
aggregation_key=aggregation_key,
limit=limit,
direction=direction,
from_token=from_token,
Expand Down
6 changes: 0 additions & 6 deletions synapse/storage/databases/main/relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ async def get_relations_for_event(
room_id: str,
relation_type: Optional[str] = None,
event_type: Optional[str] = None,
aggregation_key: Optional[str] = None,
limit: int = 5,
direction: str = "b",
from_token: Optional[StreamToken] = None,
Expand All @@ -76,7 +75,6 @@ async def get_relations_for_event(
room_id: The room the event belongs to.
relation_type: Only fetch events with this relation type, if given.
event_type: Only fetch events with this event type, if given.
aggregation_key: Only fetch events with this aggregation key, if given.
limit: Only fetch the most recent `limit` events.
direction: Whether to fetch the most recent first (`"b"`) or the
oldest first (`"f"`).
Expand Down Expand Up @@ -105,10 +103,6 @@ async def get_relations_for_event(
where_clause.append("type = ?")
where_args.append(event_type)

if aggregation_key:
where_clause.append("aggregation_key = ?")
where_args.append(aggregation_key)

pagination_clause = generate_pagination_where_clause(
direction=direction,
column_names=("topological_ordering", "stream_ordering"),
Expand Down

0 comments on commit 8b60329

Please sign in to comment.