Remove unused parameters

This commit is contained in:
Daniel Wagner-Hall 2016-01-15 13:54:03 +00:00
parent ac12b6d332
commit b5ce4f0427
2 changed files with 8 additions and 16 deletions

View File

@ -171,12 +171,10 @@ class BaseHandler(object):
) )
@defer.inlineCallbacks @defer.inlineCallbacks
def handle_new_client_event(self, event, context, extra_destinations=[], def handle_new_client_event(self, event, context, extra_users=[]):
extra_users=[], suppress_auth=False):
# We now need to go and hit out to wherever we need to hit out to. # We now need to go and hit out to wherever we need to hit out to.
if not suppress_auth: self.auth.check(event, auth_events=context.current_state)
self.auth.check(event, auth_events=context.current_state)
yield self.maybe_kick_guest_users(event, context.current_state.values()) yield self.maybe_kick_guest_users(event, context.current_state.values())
@ -258,7 +256,7 @@ class BaseHandler(object):
event, self event, self
) )
destinations = set(extra_destinations) destinations = set()
for k, s in context.current_state.items(): for k, s in context.current_state.items():
try: try:
if k[0] == EventTypes.Member: if k[0] == EventTypes.Member:

View File

@ -397,7 +397,7 @@ class RoomMemberHandler(BaseHandler):
remotedomains.add(member.domain) remotedomains.add(member.domain)
@defer.inlineCallbacks @defer.inlineCallbacks
def change_membership(self, event, context, do_auth=True, is_guest=False): def change_membership(self, event, context, is_guest=False):
""" Change the membership status of a user in a room. """ Change the membership status of a user in a room.
Args: Args:
@ -432,7 +432,7 @@ class RoomMemberHandler(BaseHandler):
if not is_guest_access_allowed: if not is_guest_access_allowed:
raise AuthError(403, "Guest access not allowed") raise AuthError(403, "Guest access not allowed")
yield self._do_join(event, context, do_auth=do_auth) yield self._do_join(event, context)
else: else:
if event.membership == Membership.LEAVE: if event.membership == Membership.LEAVE:
is_host_in_room = yield self.is_host_in_room(room_id, context) is_host_in_room = yield self.is_host_in_room(room_id, context)
@ -459,9 +459,7 @@ class RoomMemberHandler(BaseHandler):
yield self._do_local_membership_update( yield self._do_local_membership_update(
event, event,
membership=event.content["membership"],
context=context, context=context,
do_auth=do_auth,
) )
if prev_state and prev_state.membership == Membership.JOIN: if prev_state and prev_state.membership == Membership.JOIN:
@ -497,12 +495,12 @@ class RoomMemberHandler(BaseHandler):
}) })
event, context = yield self._create_new_client_event(builder) event, context = yield self._create_new_client_event(builder)
yield self._do_join(event, context, room_hosts=hosts, do_auth=True) yield self._do_join(event, context, room_hosts=hosts)
defer.returnValue({"room_id": room_id}) defer.returnValue({"room_id": room_id})
@defer.inlineCallbacks @defer.inlineCallbacks
def _do_join(self, event, context, room_hosts=None, do_auth=True): def _do_join(self, event, context, room_hosts=None):
room_id = event.room_id room_id = event.room_id
# XXX: We don't do an auth check if we are doing an invite # XXX: We don't do an auth check if we are doing an invite
@ -536,9 +534,7 @@ class RoomMemberHandler(BaseHandler):
yield self._do_local_membership_update( yield self._do_local_membership_update(
event, event,
membership=event.content["membership"],
context=context, context=context,
do_auth=do_auth,
) )
prev_state = context.current_state.get((event.type, event.state_key)) prev_state = context.current_state.get((event.type, event.state_key))
@ -603,8 +599,7 @@ class RoomMemberHandler(BaseHandler):
defer.returnValue(room_ids) defer.returnValue(room_ids)
@defer.inlineCallbacks @defer.inlineCallbacks
def _do_local_membership_update(self, event, membership, context, def _do_local_membership_update(self, event, context):
do_auth):
yield run_on_reactor() yield run_on_reactor()
target_user = UserID.from_string(event.state_key) target_user = UserID.from_string(event.state_key)
@ -613,7 +608,6 @@ class RoomMemberHandler(BaseHandler):
event, event,
context, context,
extra_users=[target_user], extra_users=[target_user],
suppress_auth=(not do_auth),
) )
@defer.inlineCallbacks @defer.inlineCallbacks