From 33286319bb52f7ce4684ec9741d65a553a8701b2 Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 5 Sep 2018 15:02:38 +0100 Subject: [PATCH] Handle \x01ACTION that's not correctly terminated with a \x01 --- IRCLineHandler.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/IRCLineHandler.py b/IRCLineHandler.py index d3bd65a3..b4b5dd11 100644 --- a/IRCLineHandler.py +++ b/IRCLineHandler.py @@ -388,9 +388,11 @@ class LineHandler(object): message = event["arbitrary"] or "" message_split = message.split(" ") target = event["args"][0] - action = message.startswith("\01ACTION ") and message.endswith("\01") + action = message.startswith("\x01ACTION ") if action: - message = message.replace("\01ACTION ", "", 1)[:-1] + message = message.replace("\x01ACTION ", "", 1) + if message.endswith("\x01"): + message = message[:-1] kwargs = {"message": message, "message_split": message_split, "server": event["server"], "tags": event["tags"],