#NEWLINE# @ defer . inlineCallbacks #NEWLINE# def check_host_in_room( self , room_id , host ) : #NEWLINE# #INDENT# curr_state = ( yield self . state . get_current_state ( room_id ) ) #NEWLINE# for event in curr_state . values ( ) : #NEWLINE# #INDENT# if ( event . type == EventTypes . Member ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# if ( UserID . from_string ( event . state_key ) . domain != host ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# #UNINDENT# except : #NEWLINE# #INDENT# logger . warn ( 'state_key not user_id: %s' , event . state_key ) #NEWLINE# continue #NEWLINE# #UNINDENT# if ( event . content [ 'membership' ] == Membership . JOIN ) : #NEWLINE# #INDENT# defer . returnValue ( True ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# defer . returnValue ( False )