From f4af582a4e3880f481db8537dccb9762c13a2590 Mon Sep 17 00:00:00 2001 From: James Vega Date: Sun, 12 Dec 2004 17:54:12 +0000 Subject: [PATCH] Fixed bug #1083822, attributing the 'dis'ee incorrectly. Now it says "for trying to dis irc.nick". Was unsure if that or "for trying to dis me" would be preferred. Change it if you have an opinion. --- plugins/Lart.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/Lart.py b/plugins/Lart.py index 3e07e046b..18ae1f138 100644 --- a/plugins/Lart.py +++ b/plugins/Lart.py @@ -85,9 +85,6 @@ class Lart(plugins.ChannelIdDatabasePlugin): (target, reason) = map(str.strip, text.split(' for ', 1)) else: (target, reason) = (text, '') - if ircutils.strEqual(target, irc.nick): - target = msg.nick - reason = 'trying to dis me' if id is not None: try: lart = self.db.get(channel, id) @@ -100,10 +97,14 @@ class Lart(plugins.ChannelIdDatabasePlugin): irc.error('There are no larts in my database for %s.' %channel) return text = self._replaceFirstPerson(lart.text, msg.nick) - reason = self._replaceFirstPerson(reason, msg.nick) + if ircutils.strEqual(target, irc.nick): + target = msg.nick + reason = self._replaceFirstPerson('trying to dis me', irc.nick) + else: + target = self._replaceFirstPerson(target, msg.nick) + reason = self._replaceFirstPerson(reason, msg.nick) if target.endswith('.'): target = target.rstrip('.') - target = self._replaceFirstPerson(target, msg.nick) text = text.replace('$who', target) if reason: text += ' for ' + reason