3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-23 19:19:31 +01:00

ts6_common: properly handle KICK without a reason

This field is optional in TS6.
This commit is contained in:
James Lu 2017-01-14 11:05:38 -08:00
parent 7245e978cd
commit 39db5aee04

View File

@ -371,8 +371,14 @@ class TS6BaseProtocol(IRCS2SProtocol):
# :70MAAAAAA KICK #test 70MAAAAAA :some reason
channel = self.irc.toLower(args[0])
kicked = self._getUid(args[1])
self.handle_part(kicked, 'KICK', [channel, args[2]])
return {'channel': channel, 'target': kicked, 'text': args[2]}
try:
reason = args[2]
except IndexError:
reason = ''
self.handle_part(kicked, 'KICK', [channel, reason])
return {'channel': channel, 'target': kicked, 'text': reason}
def handle_nick(self, numeric, command, args):
"""Handles incoming NICK changes."""