Don't call invalidCommand with CTCP messages.

This commit is contained in:
Jeremy Fincher 2004-01-07 12:00:59 +00:00
parent 58d86e7cd8
commit d6e9eafbf2

View File

@ -323,7 +323,10 @@ class IrcObjectProxy:
self.finalEval() self.finalEval()
def _callInvalidCommands(self): def _callInvalidCommands(self):
log.debug('Calling invalid commands.') if ircutils.isCtcp(self.msg):
log.debug('Skipping invalidCommand, msg is CTCP.')
return
log.debug('Calling invalidCommands.')
for cb in self.irc.callbacks: for cb in self.irc.callbacks:
log.debug('Trying to call %s.invalidCommand' % cb.name()) log.debug('Trying to call %s.invalidCommand' % cb.name())
if self.finished: if self.finished:
@ -455,6 +458,7 @@ class IrcObjectProxy:
response = '%s %s' % (response, n) response = '%s %s' % (response, n)
prefix = msg.prefix prefix = msg.prefix
if self.to and ircutils.isNick(self.to): if self.to and ircutils.isNick(self.to):
### TODO: catch this KeyError.
prefix = self.getRealIrc().state.nickToHostmask(self.to) prefix = self.getRealIrc().state.nickToHostmask(self.to)
mask = prefix.split('!', 1)[1] mask = prefix.split('!', 1)[1]
Privmsg._mores[mask] = msgs Privmsg._mores[mask] = msgs