summary refs log tree commit diff
diff options
context:
space:
mode:
authorLoren Burkholder <computersemiexpert@outlook.com>2021-02-20 13:10:14 -0500
committerNicolas Werner <nicolas.werner@hotmail.de>2021-03-17 19:17:15 +0100
commitb57b76d948407e36f05de51d80289dc82bf63464 (patch)
treec6c5f028fe3ac9585af75d4c5352eb43b2cdb105
parentCreate function for processing whether a message is a reply (diff)
downloadnheko-b57b76d948407e36f05de51d80289dc82bf63464.tar.xz
Add "replied" marker to regular reply messages
-rw-r--r--src/notifications/Manager.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/notifications/Manager.cpp b/src/notifications/Manager.cpp
index 6550445d..eee695a5 100644
--- a/src/notifications/Manager.cpp
+++ b/src/notifications/Manager.cpp
@@ -16,10 +16,17 @@ NotificationsManager::postNotification(const mtx::responses::Notification &notif
         const auto sender = cache::displayName(
           room_id, QString::fromStdString(mtx::accessors::sender(notification.event)));
 
+        const QString reply = (utils::isReply(notification.event)
+                                 ? ""
+                                 : tr(" replied",
+                                      "Used to denote that this message is a reply to another "
+                                      "message. Displayed as 'foo replied: message'."));
+
+        // the "replied" is only added if this message is not an emote message
         QString text =
           ((mtx::accessors::msg_type(notification.event) == mtx::events::MessageType::Emote)
              ? "* " + sender + " "
-             : sender + ": ") +
+             : sender + reply + ": ") +
           formatNotification(mtx::accessors::formattedBodyWithFallback(notification.event));
 
         systemPostNotification(room_id, event_id, room_name, sender, text, icon);