Better handle encrypted notifications
This commit is contained in:
parent
9168c2c785
commit
2192e8bea8
3 changed files with 56 additions and 18 deletions
|
|
@ -11,6 +11,7 @@
|
|||
#include <QTextDocumentFragment>
|
||||
|
||||
#include <functional>
|
||||
#include <variant>
|
||||
|
||||
#include <mtx/responses/notifications.hpp>
|
||||
|
||||
|
|
@ -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<mtx::events::EncryptedEvent<mtx::events::msg::Encrypted>>(
|
||||
¬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 + " "
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue