From fe0918120e356d4f88958079e649b3ec41f8e133 Mon Sep 17 00:00:00 2001 From: osmarks Date: Sat, 6 Mar 2021 22:25:31 +0000 Subject: [PATCH] =?UTF-8?q?zero=20width=20space=20in=20Discord=E2=86=92IRC?= =?UTF-8?q?=20nicknames?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/irc_link.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/irc_link.py b/src/irc_link.py index f12b501..5bab220 100644 --- a/src/irc_link.py +++ b/src/irc_link.py @@ -33,7 +33,8 @@ async def initialize(): if channel_name in util.config["irc"]["channels"]: if channel_name not in joined: conn.join(channel_name) line = msg.message.replace("\n", " ") - line = f"<{random_color(msg.author.id)}{msg.author.name}{color_code('')}> " + line.strip()[:400] + # ping fix - zero width space embedded in messages + line = f"<{random_color(msg.author.id)}{msg.author.name[0]}\u200B{msg.author.name[1:]}{color_code('')}> " + line.strip()[:400] conn.privmsg(channel_name, line) else: logging.warning("IRC channel %s not allowed", channel_name)