From e5064dffe55f3c5f6816593c28676c0f20e0b90d Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Wed, 25 Nov 2020 02:01:18 +0100 Subject: [PATCH] Don't show room name in notification if equal to sender This is the case for direct messages. --- src/notificationsmanager.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/notificationsmanager.cpp b/src/notificationsmanager.cpp index 20dc38988..d46e6e700 100644 --- a/src/notificationsmanager.cpp +++ b/src/notificationsmanager.cpp @@ -34,7 +34,13 @@ void NotificationsManager::postNotification(const QString &roomid, const QString QPixmap img; img.convertFromImage(icon); KNotification *notification = new KNotification("message"); - notification->setTitle(i18n("%1 (%2)", sender, roomname)); + + if (sender == roomname) { + notification->setTitle(sender); + } else { + notification->setTitle(i18n("%1 (%2)", sender, roomname)); + } + notification->setText(text.toHtmlEscaped()); notification->setPixmap(img); notification->sendEvent();