summary refs log tree commit diff
path: root/src/notifications/ManagerLinux.cpp
diff options
context:
space:
mode:
authorLoren Burkholder <computersemiexpert@outlook.com>2021-02-12 11:28:41 -0500
committerLoren Burkholder <computersemiexpert@outlook.com>2021-02-13 13:01:04 -0500
commit299c486a2bd1aff872fcf0b2e76300b569920fc5 (patch)
tree7f620c05b471176b4708e0dd186bcc5dbdd6b795 /src/notifications/ManagerLinux.cpp
parentMark messages as read, when Nheko gets focused (diff)
downloadnheko-299c486a2bd1aff872fcf0b2e76300b569920fc5.tar.xz
Display notifications for emote messages properly
Diffstat (limited to 'src/notifications/ManagerLinux.cpp')
-rw-r--r--src/notifications/ManagerLinux.cpp18
1 files changed, 12 insertions, 6 deletions
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<QVariant> 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.