From 9ed7e0c94199ddaf96f80916247f8eac30116131 Mon Sep 17 00:00:00 2001 From: anrodger Date: Sun, 3 Jan 2016 17:08:08 -0500 Subject: [PATCH] Strip mIRC color codes from messages The ^C/\x03 control character was already stripped, but not the foreground and background colors after it. --- skype2irc.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/skype2irc.py b/skype2irc.py index a1aae4f..d8d505a 100644 --- a/skype2irc.py +++ b/skype2irc.py @@ -256,6 +256,8 @@ def on_pong(self, connection, event): def say(self, target, msg, do_say = True): """Send messages to channels/nicks""" try: + # Strip mIRC color codes (\x03XX,YY) from the message + msg = re.sub(r"\x03\d+(,\d+)?", "", msg) lines = msg.encode("UTF-8").split("\n") cur = 0 for line in lines: