diff --git a/src/callbacks.py b/src/callbacks.py index 63329be4e..6e1e04be7 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -618,7 +618,7 @@ class IrcObjectProxy(RichReplyMethods): else: s = ircutils.safeArgument(s) allowedLength = 450 - len(self.irc.prefix) - maximumMores = conf.supybot.reply.maximumMores() + maximumMores = conf.supybot.reply.mores.maximum() maximumLength = allowedLength * maximumMores if len(s) > maximumLength: log.warning('Truncating to %s bytes from %s bytes', @@ -641,6 +641,16 @@ class IrcObjectProxy(RichReplyMethods): return msgs = ircutils.wrap(s, allowedLength-30) # -30 is for nick: msgs.reverse() + instant = conf.supybot.reply.mores.instant() + while instant > 1 and msgs: + instant -= 1 + response = msgs.pop() + self.irc.queueMsg(reply(msg, response, to=self.to, + notice=self.notice, + private=self.private, + prefixName=self.prefixName)) + if not msgs: + return response = msgs.pop() if msgs: n = ircutils.bold('(%s)') diff --git a/src/conf.py b/src/conf.py index fd994a01c..98eb1da23 100644 --- a/src/conf.py +++ b/src/conf.py @@ -284,10 +284,17 @@ registerChannelValue(supybot.reply, 'truncate', messages instead of breaking up long messages and using the 'more' command to get the remaining chunks.""")) -registerChannelValue(supybot.reply, 'maximumMores', +registerGroup(supybot.reply, 'mores') +registerChannelValue(supybot.reply.mores, 'maximum', registry.PositiveInteger(50, """Determines what the maximum number of chunks (for use with the 'more' command) will be.""")) +registerChannelValue(supybot.reply.mores, 'instant', + registry.PositiveInteger(1, """Determines how many mores will be sent + instantly (i.e., without the use of the more command, immediately when + they are formed). Defaults to 1, which means that a more command will be + required for all but the first chunk.""")) + registerGlobalValue(supybot.reply, 'oneToOne', registry.Boolean(True, """Determines whether the bot will send multi-message replies in a single messsage or in multiple messages. For