Made sure ChannelPluginTestCase only reworks the message if its command is PRIVMSG.

This commit is contained in:
Jeremy Fincher 2003-10-15 04:46:40 +00:00
parent 6476e63f20
commit 0ac86a778d

View File

@ -268,12 +268,15 @@ class ChannelPluginTestCase(PluginTestCase):
drivers.run() drivers.run()
response = self.irc.takeMsg() response = self.irc.takeMsg()
if response is not None: if response is not None:
args = list(response.args) if response.command == 'PRIVMSG':
# Strip off nick: at beginning of response. args = list(response.args)
if args[1].startswith(self.nick) or \ # Strip off nick: at beginning of response.
args[1].startswith(ircutils.nickFromHostmask(self.prefix)): if args[1].startswith(self.nick) or \
args[1] = args[1].split(None, 1)[1] args[1].startswith(ircutils.nickFromHostmask(self.prefix)):
ret = ircmsgs.privmsg(*args) args[1] = args[1].split(None, 1)[1]
ret = ircmsgs.privmsg(*args)
else:
ret = response
else: else:
ret = None ret = None
if self.myVerbose: if self.myVerbose: