3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-01-24 19:24:13 +01:00

ircs2s_common: return just the kill reason as text in kill parsing (#520)

This commit is contained in:
James Lu 2018-06-11 18:51:48 -07:00
parent 93fef9b923
commit 1a97a32ef5

View File

@ -562,11 +562,14 @@ class IRCS2SProtocol(IRCCommonProtocol):
killer = source
# Get the reason, which is enclosed in brackets.
reason = ' '.join(args[1].split(" ")[1:])
killmsg = "Killed (%s %s)" % (killer, reason)
killmsg = ' '.join(args[1].split(" ")[1:])[1:-1]
if not killmsg:
log.warning('(%s) Failed to extract kill reason: %r', irc.name, args)
killmsg = '<No reason given>'
else:
# We already have a preformatted kill, so just pass it on as is.
# XXX: this does create a convoluted kill string if we want to forward kills
# over relay.
# InspIRCd:
# <- :1MLAAAAA1 KILL 0ALAAAAAC :Killed (GL (test))
# ngIRCd: