Added extra logging to Enforcer in the case where it's not started.

This commit is contained in:
Jeremy Fincher 2003-09-22 02:46:36 +00:00
parent 90d1a55f6c
commit f137b21dcf

View File

@ -86,6 +86,7 @@ class Enforcer(callbacks.Privmsg):
def doJoin(self, irc, msg): def doJoin(self, irc, msg):
if not self.started: if not self.started:
debug.msg('Enforcer not started.', 'normal')
return return
channel = msg.args[0] channel = msg.args[0]
c = ircdb.channels.getChannel(channel) c = ircdb.channels.getChannel(channel)
@ -101,6 +102,7 @@ class Enforcer(callbacks.Privmsg):
def doTopic(self, irc, msg): def doTopic(self, irc, msg):
if not self.started: if not self.started:
debug.msg('Enforcer not started.', 'normal')
return return
channel = msg.args[0] channel = msg.args[0]
topic = msg.args[1] topic = msg.args[1]
@ -119,6 +121,7 @@ class Enforcer(callbacks.Privmsg):
def do332(self, irc, msg): def do332(self, irc, msg):
# This command gets sent right after joining a channel. # This command gets sent right after joining a channel.
if not self.started: if not self.started:
debug.msg('Enforcer not started.', 'normal')
return return
(channel, topic) = msg.args[1:] (channel, topic) = msg.args[1:]
self.topics[channel] = topic self.topics[channel] = topic
@ -133,6 +136,7 @@ class Enforcer(callbacks.Privmsg):
def doKick(self, irc, msg): def doKick(self, irc, msg):
if not self.started: if not self.started:
debug.msg('Enforcer not started.', 'normal')
return return
channel = msg.args[0] channel = msg.args[0]
kicked = msg.args[1].split(',') kicked = msg.args[1].split(',')
@ -157,6 +161,7 @@ class Enforcer(callbacks.Privmsg):
def doMode(self, irc, msg): def doMode(self, irc, msg):
if not self.started: if not self.started:
debug.msg('Enforcer not started.', 'normal')
return return
channel = msg.args[0] channel = msg.args[0]
if not ircutils.isChannel(channel): if not ircutils.isChannel(channel):
@ -216,10 +221,12 @@ class Enforcer(callbacks.Privmsg):
irc.queueMsg(ircmsgs.deop(channel, msg.nick)) irc.queueMsg(ircmsgs.deop(channel, msg.nick))
def __call__(self, irc, msg): def __call__(self, irc, msg):
if self.started and msg.prefix == self.chanserv: if self.started:
return if msg.prefix != self.chanserv and msg.nick != msg.prefix:
else:
return callbacks.Privmsg.__call__(self, irc, msg) return callbacks.Privmsg.__call__(self, irc, msg)
else:
debug.msg('Enforcer plugin not started. '
'Give the bot the startenforcer command.', 'normal')
Class = Enforcer Class = Enforcer