Make supybot.reply.oneToOne channel-specific.

This commit is contained in:
Valentin Lorentz 2012-08-10 12:27:25 +00:00
parent 19708c55cc
commit fc9daa9953
2 changed files with 7 additions and 3 deletions

View File

@ -439,7 +439,7 @@ class RichReplyMethods(object):
return self.reply(s, **kwargs) return self.reply(s, **kwargs)
def replies(self, L, prefixer=None, joiner=None, def replies(self, L, prefixer=None, joiner=None,
onlyPrefixFirst=False, **kwargs): onlyPrefixFirst=False, to=None, **kwargs):
if prefixer is None: if prefixer is None:
prefixer = '' prefixer = ''
if joiner is None: if joiner is None:
@ -448,7 +448,11 @@ class RichReplyMethods(object):
prefixer = prefixer.__add__ prefixer = prefixer.__add__
if isinstance(joiner, basestring): if isinstance(joiner, basestring):
joiner = joiner.join joiner = joiner.join
if conf.supybot.reply.oneToOne(): if ircutils.isChannel(to):
oneToOne = conf.get(conf.supybot.reply.oneToOne, to)
else:
oneToOne = conf.supybot.reply.oneToOne()
if oneToOne:
return self.reply(prefixer(joiner(L)), **kwargs) return self.reply(prefixer(joiner(L)), **kwargs)
else: else:
msg = None msg = None

View File

@ -369,7 +369,7 @@ registerChannelValue(supybot.reply.mores, 'instant',
they are formed). Defaults to 1, which means that a more command will be they are formed). Defaults to 1, which means that a more command will be
required for all but the first chunk."""))) required for all but the first chunk.""")))
registerGlobalValue(supybot.reply, 'oneToOne', registerChannelValue(supybot.reply, 'oneToOne',
registry.Boolean(True, _("""Determines whether the bot will send registry.Boolean(True, _("""Determines whether the bot will send
multi-message replies in a single message or in multiple messages. For multi-message replies in a single message or in multiple messages. For
safety purposes (so the bot is less likely to flood) it will normally send safety purposes (so the bot is less likely to flood) it will normally send