From a606ac088a5775301c36bf724bdfbca48ab26567 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?poljar=20=28Damir=20Jeli=C4=87=29?= Date: Wed, 28 Feb 2018 21:27:39 +0100 Subject: [PATCH] Only put a prefix string if there is a prefix. --- matrix/rooms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/matrix/rooms.py b/matrix/rooms.py index 1a06c70..f97f98b 100644 --- a/matrix/rooms.py +++ b/matrix/rooms.py @@ -275,8 +275,8 @@ class RoomMessageEvent(RoomEvent): prefix, prefix_color = sender_to_prefix_and_color(room, self.sender) - prefix_string = "{}{}{}".format( - W.color(prefix_color), prefix, W.color("reset")) + prefix_string = ("" if not prefix else "{}{}{}".format( + W.color(prefix_color), prefix, W.color("reset"))) data = "{prefix}{color}{author}{ncolor}\t{msg}".format( prefix=prefix_string,