diff options
Diffstat (limited to 'src/notifications/ManagerMac.mm')
-rw-r--r-- | src/notifications/ManagerMac.mm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/notifications/ManagerMac.mm b/src/notifications/ManagerMac.mm index 5609d3de..af0b5a02 100644 --- a/src/notifications/ManagerMac.mm +++ b/src/notifications/ManagerMac.mm @@ -8,6 +8,7 @@ #include "MatrixClient.h" #include "Utils.h" #include <mtx/responses/notifications.hpp> +#include <cmark.h> @interface NSUserNotification (CFIPrivate) - (void)set_identityImage:(NSImage *)image; @@ -26,15 +27,16 @@ NotificationsManager::postNotification(const mtx::responses::Notification ¬if const auto sender = cache::displayName(QString::fromStdString(notification.room_id), QString::fromStdString(mtx::accessors::sender(notification.event))); const auto text = utils::event_body(notification.event); + const auto formattedText = cmark_markdown_to_html(text.toStdString().c_str(), text.length(), CMARK_OPT_UNSAFE); NSUserNotification * notif = [[NSUserNotification alloc] init]; notif.title = QString::fromStdString(cache::singleRoomInfo(notification.room_id).name).toNSString(); notif.subtitle = QString("%1 sent a message").arg(sender).toNSString(); if (mtx::accessors::msg_type(notification.event) == mtx::events::MessageType::Emote) - notif.informativeText = QString("* ").append(sender).append(" ").append(text).toNSString(); + notif.informativeText = QString("* ").append(sender).append(" ").append(formattedText).toNSString(); else - notif.informativeText = text.toNSString(); + notif.informativeText = formattedText.toNSString(); notif.soundName = NSUserNotificationDefaultSoundName; [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification: notif]; |