#NEWLINE# def on_receive_pdu( self , pdu ) : #NEWLINE# #INDENT# ' We just received a PDU\n        ' #NEWLINE# pdu_type = pdu . pdu_type #NEWLINE# if ( pdu_type == 'sy.room.message' ) : #NEWLINE# #INDENT# self . _on_message ( pdu ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( pdu_type == 'sy.room.member' ) and ( 'membership' in pdu_type . content ) ) : #NEWLINE# #INDENT# if ( pdu . content [ 'membership' ] == 'join' ) : #NEWLINE# #INDENT# self . _on_join ( pdu . context , pdu . state_key ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( pdu . content [ 'membership' ] == 'invite' ) : #NEWLINE# #INDENT# self . _on_invite ( pdu . origin , pdu . context , pdu . state_key ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . output . print_line ( ( '#%s (unrec) %s = %s' % ( pdu . context , pdu . pdu_type , json . dumps ( pdu . content ) ) ) )