From 2192e8bea85e78435830fcb9c8a98c50637c86f8 Mon Sep 17 00:00:00 2001 From: Loren Burkholder Date: Fri, 26 Feb 2021 15:33:27 -0500 Subject: Better handle encrypted notifications --- src/notifications/ManagerLinux.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/notifications/ManagerLinux.cpp') diff --git a/src/notifications/ManagerLinux.cpp b/src/notifications/ManagerLinux.cpp index ae6fdbee..56fc8221 100644 --- a/src/notifications/ManagerLinux.cpp +++ b/src/notifications/ManagerLinux.cpp @@ -11,6 +11,7 @@ #include #include +#include #include @@ -194,6 +195,13 @@ NotificationsManager::formatNotification(const mtx::responses::Notification ¬ const auto sender = cache::displayName(QString::fromStdString(notification.room_id), QString::fromStdString(mtx::accessors::sender(notification.event))); + + // TODO: decrypt this message if the decryption setting is on in the UserSettings + if (auto msg = std::get_if>( + ¬ification.event); + msg != nullptr) + return tr("%1 sent an encrypted message").arg(sender); + const auto messageLeadIn = ((mtx::accessors::msg_type(notification.event) == mtx::events::MessageType::Emote) ? "* " + sender + " " -- cgit 1.5.1