Add third party invites to auth_events for joins

pull/302/head
Daniel Wagner-Hall 2015-10-06 10:13:28 -05:00
parent fcd9ba8802
commit 1cacc71050
1 changed files with 5 additions and 0 deletions

View File

@ -677,6 +677,11 @@ class Auth(object):
if e_type == Membership.JOIN:
if member_event and not is_public:
auth_ids.append(member_event.event_id)
if ThirdPartyInvites.has_join_keys(event.content):
key = (EventTypes.ThirdPartyInvite, event.content["token"])
invite = current_state.get(key)
if invite:
auth_ids.append(invite.event_id)
else:
if member_event:
auth_ids.append(member_event.event_id)