#NEWLINE# def _post_connect( self ) : #NEWLINE# #INDENT# 'Initialize authentication when the connection is established\n        and we are the initiator.' #NEWLINE# if ( not self . initiator ) : #NEWLINE# #INDENT# if ( ( 'plain' in self . auth_methods ) or ( 'digest' in self . auth_methods ) ) : #NEWLINE# #INDENT# self . set_iq_get_handler ( 'query' , 'jabber:iq:auth' , self . auth_in_stage1 ) #NEWLINE# self . set_iq_set_handler ( 'query' , 'jabber:iq:auth' , self . auth_in_stage2 ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if self . registration_callback : #NEWLINE# #INDENT# iq = Iq ( stanza_type = 'get' ) #NEWLINE# iq . set_content ( Register ( ) ) #NEWLINE# self . set_response_handlers ( iq , self . registration_form_received , self . registration_error ) #NEWLINE# self . send ( iq ) #NEWLINE# return #NEWLINE# #UNINDENT# #UNINDENT# ClientStream . _post_connect ( self )