From 26e7f3780c41d35efc71ca37451ca893acb8245a Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Wed, 7 Jan 2026 15:42:19 -0500 Subject: [PATCH] Small notification improvements Changed a check to use isDirectChat (which is a clearer indication of what we want.) I also made sure not to show the account name if you only have one, since that's just useless noise. (cherry picked from commit fc6f345036abc53c940b0bec2e24b2e5ae017c99) --- src/app/notificationsmanager.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/app/notificationsmanager.cpp b/src/app/notificationsmanager.cpp index ca1517d47..75a425f85 100644 --- a/src/app/notificationsmanager.cpp +++ b/src/app/notificationsmanager.cpp @@ -216,12 +216,12 @@ void NotificationsManager::postNotification(NeoChatRoom *room, } }); + notification->setTitle(room->displayName()); + QString entry; - if (sender == room->displayName()) { - notification->setTitle(sender); + if (room->isDirectChat()) { entry = text.toHtmlEscaped(); } else { - notification->setTitle(room->displayName()); entry = i18n("%1: %2", sender, text.toHtmlEscaped()); } @@ -253,7 +253,9 @@ void NotificationsManager::postNotification(NeoChatRoom *room, notification->setReplyAction(std::move(replyAction)); } - notification->setHint(u"x-kde-origin-name"_s, room->localMember().id()); + if (Controller::instance().accounts()->rowCount() > 1) { + notification->setHint(u"x-kde-origin-name"_s, room->localMember().id()); + } notification->sendEvent(); } @@ -347,7 +349,9 @@ void NotificationsManager::doPostInviteNotification(QPointer room) m_invitations.remove(room->id()); }); - notification->setHint(u"x-kde-origin-name"_s, room->localMember().id()); + if (Controller::instance().accounts()->rowCount() > 1) { + notification->setHint(u"x-kde-origin-name"_s, room->localMember().id()); + } notification->sendEvent(); }