@@ -297,11 +297,20 @@ def doBatch(self, irc, msg):
297297 self ._doPrivmsgs (irc , synthetic_msg )
298298
299299 def doPrivmsg (self , irc , msg ):
300- if conf .supybot .protocols .irc .experimentalExtensions ():
301- if 'batch' in msg .server_tags \
302- and any (batch .type == 'draft/multiline'
303- for batch in irc .state .getParentBatches (msg )):
304- # We will handle the message in doBatch when the entire batch ends.
300+ if 'batch' in msg .server_tags :
301+ parent_batches = irc .state .getParentBatches (msg )
302+ parent_batch_types = [batch .type for batch in parent_batches ]
303+ if 'draft/multiline' in parent_batch_types \
304+ and conf .supybot .protocols .irc .experimentalExtensions ():
305+ # We will handle the message in doBatch when the entire
306+ # batch ends.
307+ return
308+ if 'chathistory' in parent_batch_types :
309+ # Either sent automatically by the server upon join,
310+ # or triggered by a plugin (why?!)
311+ # Either way, replying to commands from the history would
312+ # look weird, because it may have been sent a while ago,
313+ # and we may have already answered to it.
305314 return
306315
307316 self ._doPrivmsgs (irc , msg )
0 commit comments