From 0284ec803e1187d858f1b5c7469d36c4a21f635e Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Fri, 16 Apr 2004 07:50:06 +0000 Subject: [PATCH] Added supybot.plugins.LogToIrc.notice, for sending logs to nicks via NOTICE instead of PRIVMSG. --- plugins/LogToIrc.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/LogToIrc.py b/plugins/LogToIrc.py index 5ec6ba613..34591450c 100644 --- a/plugins/LogToIrc.py +++ b/plugins/LogToIrc.py @@ -60,7 +60,10 @@ class IrcHandler(logging.Handler): except: self.handleError(record) for target in config.targets(): - msg = ircmsgs.privmsg(target, s) + msgmaker = ircmsgs.privmsg + if config.notice() and not ircutils.isChannel(target): + msgmaker = ircmsgs.notice + msg = msgmaker(target, s) for irc in world.ircs: try: if not irc.driver.connected: @@ -166,6 +169,11 @@ conf.registerGlobalValue(conf.supybot.plugins.LogToIrc, conf.registerGlobalValue(conf.supybot.plugins.LogToIrc, 'colorized', registry.Boolean(False, """Determines whether the bot's logs to IRC will be colorized with mIRC colors.""")) +conf.registerGlobalValue(conf.supybot.plugins.LogToIrc, 'notice', + registry.Boolean(False, """Determines whether the bot's logs to IRC will be + sent via NOTICE instead of PRIVMSG. Channels will always be PRIVMSGed, + regardless of this variable; NOTICEs will only be used if this variable is + True and the target is a nick, not a channel.""")) def configure(advanced): from questions import something, anything, yn, output