From 2f488bd9e3ad9ed632078f6e1ca0a47c0d5d544f Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Thu, 28 Sep 2017 22:26:24 +0300 Subject: [PATCH] Don't mangle bot's display name --- src/TimelineItem.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/TimelineItem.cc b/src/TimelineItem.cc index 70fc113f..a6eb2bea 100644 --- a/src/TimelineItem.cc +++ b/src/TimelineItem.cc @@ -321,9 +321,11 @@ TimelineItem::generateBody(const QString &userid, const QString &body) { auto sender = userid; - // TODO: Fix this by using a UserId type. - if (userid.split(":")[0].split("@").size() > 1) - sender = userid.split(":")[0].split("@")[1]; + if (userid.startsWith("@")) { + // TODO: Fix this by using a UserId type. + if (userid.split(":")[0].split("@").size() > 1) + sender = userid.split(":")[0].split("@")[1]; + } QString userContent(" %1 "); QString bodyContent(" %1 ");