diff --git a/ChangeLog b/ChangeLog index a3aecd3de..13826fa8d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ - * Added supybot.reply.truncate, to turn off the normal more'ing - of replies. + * Added supybot.reply.maximumMores, to give users the ability to + set the maximum number of "more" chunks replies will generate. + + * Added supybot.reply.truncate, to turn off the normal chunking + of replies that later can be retrieved with the more command. + Setting this variable to On means that no chunks will ever be + created. * Added supybot.plugins.Enforcer.takeRevengeOnOps, which makes the bot even take revenge on #channel,ops who try to violate the diff --git a/src/callbacks.py b/src/callbacks.py index cf8f477a4..0eac719f7 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -567,9 +567,11 @@ class IrcObjectProxy(RichReplyMethods): else: s = ircutils.safeArgument(s) allowedLength = 450 - len(self.irc.prefix) - if len(s) > allowedLength*50: - log.warning('Cowardly refusing to "more" %s bytes.'%len(s)) - s = s[:allowedLength*50] + maximumLength = allowedLength*conf.supybot.reply.maximumMores() + if len(s) > maximumLength: + log.warning('Truncating to %s bytes from %s bytes', + maximumLength, len(s)) + s = s[:maximumLength] if len(s) < allowedLength or conf.supybot.reply.truncate(): s = s[:allowedLength+20] # In case we're truncating. self.irc.queueMsg(reply(msg, s, self.prefixName, diff --git a/src/conf.py b/src/conf.py index b93f85d15..420bee759 100644 --- a/src/conf.py +++ b/src/conf.py @@ -193,6 +193,9 @@ supybot.register('reply') supybot.reply.register('truncate', registry.Boolean(False, """Determines whether the bot will simply truncate messages instead of breaking up long messages and using the 'more' command to get the remaining chunks.""")) +supybot.reply.register('maximumMores', registry.PositiveInteger(50, """ +Determines what the maximum number of chunks (for use with the 'more' command) +will be.""")) supybot.reply.register('oneToOne', registry.Boolean(True, """Determines whether the bot will send multi-message replies in a single messsage or in multiple