Skip to content

Commit

Permalink
ChannelLogger: check for logChannelMessages before logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
progval committed Apr 26, 2013
1 parent 243cc0b commit fe540b3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion plugins/ChannelLogger/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

import supybot.conf as conf
import supybot.world as world
import supybot.ircdb as ircdb
import supybot.irclib as irclib
import supybot.ircmsgs as ircmsgs
import supybot.ircutils as ircutils
Expand Down Expand Up @@ -183,7 +184,14 @@ def doPrivmsg(self, irc, msg):
for channel in recipients.split(','):
if irc.isChannel(channel):
noLogPrefix = self.registryValue('noLogPrefix', channel)
if noLogPrefix and text.startswith(noLogPrefix):
cap = ircdb.makeChannelCapability(channel, 'logChannelMessages')
try:
logChannelMessages = ircdb.checkCapability(msg.prefix, cap,
ignoreOwner=True)
except KeyError:
logChannelMessages = True
if (noLogPrefix and text.startswith(noLogPrefix)) or \
not logChannelMessages:
text = '-= THIS MESSAGE NOT LOGGED =-'
nick = msg.nick or irc.nick
if ircmsgs.isAction(msg):
Expand Down

0 comments on commit fe540b3

Please sign in to comment.