From 1a97a32ef557e76bba6d0159faa255522133b09d Mon Sep 17 00:00:00 2001 From: James Lu Date: Mon, 11 Jun 2018 18:51:48 -0700 Subject: [PATCH] ircs2s_common: return just the kill reason as text in kill parsing (#520) --- protocols/ircs2s_common.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/protocols/ircs2s_common.py b/protocols/ircs2s_common.py index 2e46fe9..8424bdb 100644 --- a/protocols/ircs2s_common.py +++ b/protocols/ircs2s_common.py @@ -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 = '' 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: