From 299c486a2bd1aff872fcf0b2e76300b569920fc5 Mon Sep 17 00:00:00 2001 From: Loren Burkholder Date: Fri, 12 Feb 2021 11:28:41 -0500 Subject: Display notifications for emote messages properly --- src/notifications/ManagerLinux.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/notifications/ManagerLinux.cpp') diff --git a/src/notifications/ManagerLinux.cpp b/src/notifications/ManagerLinux.cpp index 8f7261e6..7dbf663d 100644 --- a/src/notifications/ManagerLinux.cpp +++ b/src/notifications/ManagerLinux.cpp @@ -50,17 +50,23 @@ NotificationsManager::postNotification(const QString &roomid, const QString &roomname, const QString &sender, const QString &text, - const QImage &icon) + const QImage &icon, + const bool &isEmoteMessage) { QVariantMap hints; hints["image-data"] = icon; hints["sound-name"] = "message-new-instant"; QList argumentList; - argumentList << "nheko"; // app_name - argumentList << (uint)0; // replace_id - argumentList << ""; // app_icon - argumentList << roomname; // summary - argumentList << sender + ": " + text; // body + argumentList << "nheko"; // app_name + argumentList << (uint)0; // replace_id + argumentList << ""; // app_icon + argumentList << roomname; // summary + + // body + if (isEmoteMessage) + argumentList << "* " + sender + " " + text; + else + argumentList << sender + ": " + text; // The list of actions has always the action name and then a localized version of that // action. Currently we just use an empty string for that. // TODO(Nico): Look into what to actually put there. -- cgit 1.4.1