#NEWLINE# @ defer . inlineCallbacks #NEWLINE# def check_joined_room( self , room_id , user_id , current_state = None ) : #NEWLINE# #INDENT# 'Check if the user is currently joined in the room\n        Args:\n            room_id(str): The room to check.\n            user_id(str): The user to check.\n            current_state(dict): Optional map of the current state of the room.\n                If provided then that map is used to check whether they are a\n                member of the room. Otherwise the current membership is\n                loaded from the database.\n        Raises:\n            AuthError if the user is not in the room.\n        Returns:\n            A deferred membership event for the user if the user is in\n            the room.\n        ' #NEWLINE# if current_state : #NEWLINE# #INDENT# member = current_state . get ( ( EventTypes . Member , user_id ) , None ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# member = ( yield self . state . get_current_state ( room_id = room_id , event_type = EventTypes . Member , state_key = user_id ) ) #NEWLINE# #UNINDENT# self . _check_joined_room ( member , user_id , room_id ) #NEWLINE# defer . returnValue ( member )