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

rename replication_layer to federation_client #3634

Merged
merged 2 commits into from
Aug 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/3634.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rename replication_layer to federation_client
28 changes: 14 additions & 14 deletions synapse/handlers/federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(self, hs):
self.hs = hs

self.store = hs.get_datastore()
self.replication_layer = hs.get_federation_client()
self.federation_client = hs.get_federation_client()
self.state_handler = hs.get_state_handler()
self.server_name = hs.hostname
self.keyring = hs.get_keyring()
Expand Down Expand Up @@ -255,7 +255,7 @@ def on_receive_pdu(
# know about
for p in prevs - seen:
state, got_auth_chain = (
yield self.replication_layer.get_state_for_room(
yield self.federation_client.get_state_for_room(
origin, pdu.room_id, p
)
)
Expand Down Expand Up @@ -338,7 +338,7 @@ def _get_missing_events_for_pdu(self, origin, pdu, prevs, min_depth):
#
# see https://github.com/matrix-org/synapse/pull/1744

missing_events = yield self.replication_layer.get_missing_events(
missing_events = yield self.federation_client.get_missing_events(
origin,
pdu.room_id,
earliest_events_ids=list(latest),
Expand Down Expand Up @@ -522,7 +522,7 @@ def backfill(self, dest, room_id, limit, extremities):
if dest == self.server_name:
raise SynapseError(400, "Can't backfill from self.")

events = yield self.replication_layer.backfill(
events = yield self.federation_client.backfill(
dest,
room_id,
limit=limit,
Expand Down Expand Up @@ -570,7 +570,7 @@ def backfill(self, dest, room_id, limit, extremities):
state_events = {}
events_to_state = {}
for e_id in edges:
state, auth = yield self.replication_layer.get_state_for_room(
state, auth = yield self.federation_client.get_state_for_room(
destination=dest,
room_id=room_id,
event_id=e_id
Expand Down Expand Up @@ -612,7 +612,7 @@ def backfill(self, dest, room_id, limit, extremities):
results = yield logcontext.make_deferred_yieldable(defer.gatherResults(
[
logcontext.run_in_background(
self.replication_layer.get_pdu,
self.federation_client.get_pdu,
[dest],
event_id,
outlier=True,
Expand Down Expand Up @@ -893,7 +893,7 @@ def send_invite(self, target_host, event):

Invites must be signed by the invitee's server before distribution.
"""
pdu = yield self.replication_layer.send_invite(
pdu = yield self.federation_client.send_invite(
destination=target_host,
room_id=event.room_id,
event_id=event.event_id,
Expand Down Expand Up @@ -955,7 +955,7 @@ def do_invite_join(self, target_hosts, room_id, joinee, content):
target_hosts.insert(0, origin)
except ValueError:
pass
ret = yield self.replication_layer.send_join(target_hosts, event)
ret = yield self.federation_client.send_join(target_hosts, event)

origin = ret["origin"]
state = ret["state"]
Expand Down Expand Up @@ -1211,7 +1211,7 @@ def do_remotely_reject_invite(self, target_hosts, room_id, user_id):
except ValueError:
pass

yield self.replication_layer.send_leave(
yield self.federation_client.send_leave(
target_hosts,
event
)
Expand All @@ -1234,7 +1234,7 @@ def do_remotely_reject_invite(self, target_hosts, room_id, user_id):
@defer.inlineCallbacks
def _make_and_verify_event(self, target_hosts, room_id, user_id, membership,
content={},):
origin, pdu = yield self.replication_layer.make_membership_event(
origin, pdu = yield self.federation_client.make_membership_event(
target_hosts,
room_id,
user_id,
Expand Down Expand Up @@ -1567,7 +1567,7 @@ def _persist_auth_tree(self, origin, auth_events, state, event):
missing_auth_events.add(e_id)

for e_id in missing_auth_events:
m_ev = yield self.replication_layer.get_pdu(
m_ev = yield self.federation_client.get_pdu(
[origin],
e_id,
outlier=True,
Expand Down Expand Up @@ -1777,7 +1777,7 @@ def do_auth(self, origin, event, context, auth_events):
logger.info("Missing auth: %s", missing_auth)
# If we don't have all the auth events, we need to get them.
try:
remote_auth_chain = yield self.replication_layer.get_event_auth(
remote_auth_chain = yield self.federation_client.get_event_auth(
origin, event.room_id, event.event_id
)

Expand Down Expand Up @@ -1893,7 +1893,7 @@ def do_auth(self, origin, event, context, auth_events):

try:
# 2. Get remote difference.
result = yield self.replication_layer.query_auth(
result = yield self.federation_client.query_auth(
origin,
event.room_id,
event.event_id,
Expand Down Expand Up @@ -2192,7 +2192,7 @@ def exchange_third_party_invite(
yield member_handler.send_membership_event(None, event, context)
else:
destinations = set(x.split(":", 1)[-1] for x in (sender_user_id, room_id))
yield self.replication_layer.forward_third_party_invite(
yield self.federation_client.forward_third_party_invite(
destinations,
room_id,
event_dict,
Expand Down