From a29ec0a18a29ff6314d0efa12117da13cb675318 Mon Sep 17 00:00:00 2001 From: Christopher Hock Date: Sat, 15 Jan 2022 17:56:25 +0100 Subject: [PATCH] Use the x-kde-origin-name notification hint to pass the account name to push notifications --- src/notificationsmanager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/notificationsmanager.cpp b/src/notificationsmanager.cpp index 42eeb246d..7fbeb43a2 100644 --- a/src/notificationsmanager.cpp +++ b/src/notificationsmanager.cpp @@ -66,6 +66,9 @@ void NotificationsManager::postNotification(NeoChatRoom *room, connect(replyAction.get(), &KNotificationReplyAction::replied, this, [room, replyEventId](const QString &text) { room->postMessage(text, room->preprocessText(text), RoomMessageEvent::MsgType::Text, replyEventId, QString()); }); + + notification->setHint(QStringLiteral("x-kde-origin-name"), room->localUser()->id()); + notification->setReplyAction(std::move(replyAction)); notification->sendEvent(); @@ -99,6 +102,9 @@ void NotificationsManager::postInviteNotification(NeoChatRoom *room, const QStri connect(notification, &KNotification::action2Activated, this, [room]() { RoomManager::instance().leaveRoom(room); }); + + notification->setHint(QStringLiteral("x-kde-origin-name"), room->localUser()->id()); + notification->sendEvent(); m_notifications.insert(room->id(), notification); }