#NEWLINE# def _punishRelayers( self , msg ) : #NEWLINE# #INDENT# assert self . _checkRelayMsg ( msg ) , 'Punishing without checking.' #NEWLINE# who = msg . prefix #NEWLINE# channel = msg . args [ 0 ] #NEWLINE# def notPunishing( irc , s , * args ) : #NEWLINE# #INDENT# self . log . info ( 'Not punishing %s in %s on %s: %s.' , msg . prefix , channel , irc . network , s , * args ) #NEWLINE# #UNINDENT# for irc in world . ircs : #NEWLINE# #INDENT# if ( channel in irc . state . channels ) : #NEWLINE# #INDENT# if ( irc . nick in irc . state . channels [ channel ] . ops ) : #NEWLINE# #INDENT# if ( who in irc . state . channels [ channel ] . bans ) : #NEWLINE# #INDENT# notPunishing ( irc , 'already banned' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . log . info ( 'Punishing %s in %s on %s for relaying.' , who , channel , irc . network ) #NEWLINE# irc . sendMsg ( ircmsgs . ban ( channel , who ) ) #NEWLINE# kmsg = _ ( 'You seem to be relaying, punk.' ) #NEWLINE# irc . sendMsg ( ircmsgs . kick ( channel , msg . nick , kmsg ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# notPunishing ( irc , 'not opped' )