From c7846e415ae50976ffe101d437fd623729c1795c Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Mon, 20 Jun 2011 20:27:20 -0500 Subject: [PATCH] IrcAdmin: don't crash by trying to tell #chan that you just left #chan --- BUGS | 2 -- modules/IrcAdmin.py | 6 ++++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/BUGS b/BUGS index bfa6421..d90c96b 100644 --- a/BUGS +++ b/BUGS @@ -1,7 +1,5 @@ dr.botzo --- BUGS - * being in #chan and telling the bot to !part #chan is a crash if it can't message - #chan after it leaves * Countdown formatting has singular nouns for negative numbers (-21 day) * probably many, many more * possible to have not well-formed XML in pywapi.get_weather_from_google: diff --git a/modules/IrcAdmin.py b/modules/IrcAdmin.py index d9924c6..f98bddc 100644 --- a/modules/IrcAdmin.py +++ b/modules/IrcAdmin.py @@ -95,12 +95,14 @@ class IrcAdmin(Module): def sub_part_channel(self, connection, event, nick, userhost, what, admin_unlocked): whats = what.split(' ') + target = event.target() channel = whats[1] if irclib.is_channel(channel): connection.part(channel, ' '.join(whats[2:])) - replystr = 'Parted ' + channel + '.' - return replystr + if target != channel: + replystr = 'Parted ' + channel + '.' + return replystr def sub_quit_irc(self, connection, event, nick, userhost, what, admin_unlocked): whats = what.split(' ')