Avoid splitting PRIVMSG payload on :

This commit is contained in:
moneromooo 2015-01-03 18:33:50 +00:00
parent e1cd8042c1
commit d7f3ee7f3f

View file

@ -388,6 +388,8 @@ def IRCLoop(on_idle,on_identified,on_command):
elif action == 'PRIVMSG': elif action == 'PRIVMSG':
UpdateLastActiveTime(chan,GetNick(who)) UpdateLastActiveTime(chan,GetNick(who))
# resplit to avoid splitting text that contains ':'
text = data.split(':',2)[2]
exidx = text.find('!') exidx = text.find('!')
if exidx != -1 and len(text)>exidx+1 and text[exidx+1] in string.ascii_letters: if exidx != -1 and len(text)>exidx+1 and text[exidx+1] in string.ascii_letters:
cmd = text.split('!')[1] cmd = text.split('!')[1]