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

Commit

Permalink
Merge pull request #368 from matrix-org/erikj/fix_federation_profile
Browse files Browse the repository at this point in the history
Fix missing profile data in federation joins
  • Loading branch information
erikjohnston committed Nov 12, 2015
2 parents 49f1758 + c0b3554 commit 018b504
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
5 changes: 4 additions & 1 deletion synapse/federation/federation_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,8 @@ def get_event_auth(self, destination, room_id, event_id):
defer.returnValue(signed_auth)

@defer.inlineCallbacks
def make_membership_event(self, destinations, room_id, user_id, membership):
def make_membership_event(self, destinations, room_id, user_id, membership,
content={},):
"""
Creates an m.room.member event, with context, without participating in the room.
Expand Down Expand Up @@ -398,6 +399,8 @@ def make_membership_event(self, destinations, room_id, user_id, membership):

logger.debug("Got response to make_%s: %s", membership, pdu_dict)

pdu_dict["content"].update(content)

defer.returnValue(
(destination, self.event_from_pdu_json(pdu_dict))
)
Expand Down
11 changes: 7 additions & 4 deletions synapse/handlers/federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ def on_event_auth(self, event_id):

@log_function
@defer.inlineCallbacks
def do_invite_join(self, target_hosts, room_id, joinee):
def do_invite_join(self, target_hosts, room_id, joinee, content):
""" Attempts to join the `joinee` to the room `room_id` via the
server `target_host`.
Expand All @@ -584,7 +584,8 @@ def do_invite_join(self, target_hosts, room_id, joinee):
target_hosts,
room_id,
joinee,
"join"
"join",
content,
)

self.room_queues[room_id] = []
Expand Down Expand Up @@ -840,12 +841,14 @@ def do_remotely_reject_invite(self, target_hosts, room_id, user_id):
defer.returnValue(None)

@defer.inlineCallbacks
def _make_and_verify_event(self, target_hosts, room_id, user_id, membership):
def _make_and_verify_event(self, target_hosts, room_id, user_id, membership,
content={},):
origin, pdu = yield self.replication_layer.make_membership_event(
target_hosts,
room_id,
user_id,
membership
membership,
content,
)

logger.debug("Got response to make_%s: %s", membership, pdu)
Expand Down
3 changes: 2 additions & 1 deletion synapse/handlers/room.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,8 @@ def _do_join(self, event, context, room_hosts=None, do_auth=True):
yield handler.do_invite_join(
room_hosts,
room_id,
event.user_id
event.user_id,
event.content,
)
else:
logger.debug("Doing normal join")
Expand Down

0 comments on commit 018b504

Please sign in to comment.