From d5d22985f5befb7116b9465de0186d3885427a88 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 13 Mar 2021 15:14:33 +0100 Subject: [PATCH] irclib: Remove special-casing of the last instant message in _sendReply There is no reason for it to be special; and this special-casing would be annoying when we add support for outgoing multiline batches. --- src/callbacks.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/callbacks.py b/src/callbacks.py index 0f9741668..60a232025 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -1045,7 +1045,7 @@ class NestedCommandsIrcProxy(ReplyIrcProxy): chunk = '%s %s' % (chunk, n) msgs.append(_makeReply(self, msg, chunk, **replyArgs)) - while instant > 1 and msgs: + while instant > 0 and msgs: instant -= 1 response = msgs.pop() sendMsg(response) @@ -1056,7 +1056,6 @@ class NestedCommandsIrcProxy(ReplyIrcProxy): # return m if not msgs: return - response = msgs.pop() prefix = msg.prefix if self.to and ircutils.isNick(self.to): try: @@ -1069,7 +1068,6 @@ class NestedCommandsIrcProxy(ReplyIrcProxy): public = bool(self.msg.channel) private = self.private or not public self._mores[msg.nick] = (private, msgs) - sendMsg(response) return response def noReply(self, msg=None):