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

Commit

Permalink
Add back the replication requester.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Mar 1, 2021
1 parent d91327d commit 8cbc815
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions synapse/replication/http/membership.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from twisted.web.server import Request

from synapse.http.servlet import parse_json_object_from_request
from synapse.http.site import SynapseRequest
from synapse.replication.http._base import ReplicationEndpoint
from synapse.types import JsonDict, Requester, UserID
from synapse.util.distributor import user_left_room
Expand Down Expand Up @@ -78,13 +79,16 @@ async def _serialize_payload( # type: ignore
}

async def _handle_request( # type: ignore
self, request: Request, room_id: str, user_id: str
self, request: SynapseRequest, room_id: str, user_id: str
) -> Tuple[int, JsonDict]:
content = parse_json_object_from_request(request)

remote_room_hosts = content["remote_room_hosts"]
event_content = content["content"]

requester = Requester.deserialize(self.store, content["requester"])
request.requester = requester

logger.info("remote_join: %s into room: %s", user_id, room_id)

event_id, stream_id = await self.federation_handler.do_invite_join(
Expand Down Expand Up @@ -143,14 +147,15 @@ async def _serialize_payload( # type: ignore
}

async def _handle_request( # type: ignore
self, request: Request, invite_event_id: str
self, request: SynapseRequest, invite_event_id: str
) -> Tuple[int, JsonDict]:
content = parse_json_object_from_request(request)

txn_id = content["txn_id"]
event_content = content["content"]

requester = Requester.deserialize(self.store, content["requester"])
request.requester = requester

# hopefully we're now on the master, so this won't recurse!
event_id, stream_id = await self.member_handler.remote_reject_invite(
Expand Down

0 comments on commit 8cbc815

Please sign in to comment.