#NEWLINE# def privmsg( self , sock , source , target , message ) : #NEWLINE# #INDENT# user = self . users [ sock ] #NEWLINE# if target . startswith ( '#' ) : #NEWLINE# #INDENT# if ( target not in self . channels ) : #NEWLINE# #INDENT# return self . fire ( reply ( sock , ERR_NOSUCHCHANNEL ( target ) ) ) #NEWLINE# #UNINDENT# channel = self . channels [ target ] #NEWLINE# self . _notify ( channel . users , Message ( 'PRIVMSG' , target , message , prefix = user . prefix ) , user ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( target not in self . nicks ) : #NEWLINE# #INDENT# return self . fire ( reply ( sock , ERR_NOSUCHNICK ( target ) ) ) #NEWLINE# #UNINDENT# self . fire ( reply ( self . nicks [ target ] . sock , Message ( 'PRIVMSG' , target , message , prefix = user . prefix ) ) )