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

Commit cd17a20

Browse files
Remove origin parameter from add_display_name_to_third_party_invite and add params to docstring (#6010)
Another small fixup noticed during work on a larger PR. The `origin` field of `add_display_name_to_third_party_invite` is not used and likely was just carried over from the `on_PUT` method of `FederationThirdPartyInviteExchangeServlet` which, like all other servlets, provides an `origin` argument. Since it's not used anywhere in the handler function though, we should remove it from the function arguments.
1 parent 5e9b05d commit cd17a20

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

changelog.d/6010.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove unused `origin` argument on FederationHandler.add_display_name_to_third_party_invite.

synapse/federation/federation_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -669,9 +669,9 @@ def exchange_third_party_invite(
669669
return ret
670670

671671
@defer.inlineCallbacks
672-
def on_exchange_third_party_invite_request(self, origin, room_id, event_dict):
672+
def on_exchange_third_party_invite_request(self, room_id, event_dict):
673673
ret = yield self.handler.on_exchange_third_party_invite_request(
674-
origin, room_id, event_dict
674+
room_id, event_dict
675675
)
676676
return ret
677677

synapse/federation/transport/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ class FederationThirdPartyInviteExchangeServlet(BaseFederationServlet):
575575

576576
async def on_PUT(self, origin, content, query, room_id):
577577
content = await self.handler.on_exchange_third_party_invite_request(
578-
origin, room_id, content
578+
room_id, content
579579
)
580580
return 200, content
581581

synapse/handlers/federation.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2530,12 +2530,17 @@ def exchange_third_party_invite(
25302530

25312531
@defer.inlineCallbacks
25322532
@log_function
2533-
def on_exchange_third_party_invite_request(self, origin, room_id, event_dict):
2533+
def on_exchange_third_party_invite_request(self, room_id, event_dict):
25342534
"""Handle an exchange_third_party_invite request from a remote server
25352535
25362536
The remote server will call this when it wants to turn a 3pid invite
25372537
into a normal m.room.member invite.
25382538
2539+
Args:
2540+
room_id (str): The ID of the room.
2541+
2542+
event_dict (dict[str, Any]): Dictionary containing the event body.
2543+
25392544
Returns:
25402545
Deferred: resolves (to None)
25412546
"""

0 commit comments

Comments
 (0)