#NEWLINE# @ internationalizeDocstring #NEWLINE# def since( self , irc , msg , args , channel , nick ) : #NEWLINE# #INDENT# '[<channel>] [<nick>]\n\n        Returns the messages since <nick> last left the channel.\n        If <nick> is not given, it defaults to the nickname of the person\n        calling the command.\n        ' #NEWLINE# if ( nick is None ) : #NEWLINE# #INDENT# nick = msg . nick #NEWLINE# you = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# you = False #NEWLINE# #UNINDENT# self . _checkChannelPresence ( irc , channel , nick , you ) #NEWLINE# if ( nick is None ) : #NEWLINE# #INDENT# nick = msg . nick #NEWLINE# #UNINDENT# end = None #NEWLINE# for ( i , m ) in utils . seq . renumerate ( irc . state . history ) : #NEWLINE# #INDENT# if ( ( end is None ) and ( m . command == 'JOIN' ) and ircutils . strEqual ( m . args [ 0 ] , channel ) and ircutils . strEqual ( m . nick , nick ) ) : #NEWLINE# #INDENT# end = i #NEWLINE# #UNINDENT# if ( ( m . command == 'PART' ) and ircutils . strEqual ( m . nick , nick ) and ircutils . strEqual ( m . args [ 0 ] , channel ) ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( m . command == 'QUIT' ) and ircutils . strEqual ( m . nick , nick ) ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( m . command == 'KICK' ) and ircutils . strEqual ( m . args [ 1 ] , nick ) and ircutils . strEqual ( m . args [ 0 ] , channel ) ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# irc . error ( format ( _ ( "I couldn't find in my history of %s messages where %r last left %s" ) , len ( irc . state . history ) , nick , channel ) ) #NEWLINE# return #NEWLINE# #UNINDENT# msgs = [ m for m in irc . state . history [ i : end ] if ( ( m . command == 'PRIVMSG' ) and ircutils . strEqual ( m . args [ 0 ] , channel ) ) ] #NEWLINE# if msgs : #NEWLINE# #INDENT# irc . reply ( format ( '%L' , list ( map ( ircmsgs . prettyPrint , msgs ) ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# irc . reply ( format ( _ ( "Either %s didn't leave, or no messages were sent while %s was gone." ) , msg , nick ) )