IrcAdmin: don't crash by trying to tell #chan that you just left #chan
This commit is contained in:
parent
75ba29739c
commit
c7846e415a
2
BUGS
2
BUGS
|
@ -1,7 +1,5 @@
|
||||||
dr.botzo --- BUGS
|
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)
|
* Countdown formatting has singular nouns for negative numbers (-21 day)
|
||||||
* probably many, many more
|
* probably many, many more
|
||||||
* possible to have not well-formed XML in pywapi.get_weather_from_google:
|
* possible to have not well-formed XML in pywapi.get_weather_from_google:
|
||||||
|
|
|
@ -95,12 +95,14 @@ class IrcAdmin(Module):
|
||||||
|
|
||||||
def sub_part_channel(self, connection, event, nick, userhost, what, admin_unlocked):
|
def sub_part_channel(self, connection, event, nick, userhost, what, admin_unlocked):
|
||||||
whats = what.split(' ')
|
whats = what.split(' ')
|
||||||
|
target = event.target()
|
||||||
|
|
||||||
channel = whats[1]
|
channel = whats[1]
|
||||||
if irclib.is_channel(channel):
|
if irclib.is_channel(channel):
|
||||||
connection.part(channel, ' '.join(whats[2:]))
|
connection.part(channel, ' '.join(whats[2:]))
|
||||||
replystr = 'Parted ' + channel + '.'
|
if target != channel:
|
||||||
return replystr
|
replystr = 'Parted ' + channel + '.'
|
||||||
|
return replystr
|
||||||
|
|
||||||
def sub_quit_irc(self, connection, event, nick, userhost, what, admin_unlocked):
|
def sub_quit_irc(self, connection, event, nick, userhost, what, admin_unlocked):
|
||||||
whats = what.split(' ')
|
whats = what.split(' ')
|
||||||
|
|
Loading…
Reference in New Issue