diff options
-rw-r--r-- | Swift/QtUI/FreeDesktopNotifier.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Swift/QtUI/FreeDesktopNotifier.cpp b/Swift/QtUI/FreeDesktopNotifier.cpp index e027043..6db1da1 100644 --- a/Swift/QtUI/FreeDesktopNotifier.cpp +++ b/Swift/QtUI/FreeDesktopNotifier.cpp @@ -31,6 +31,11 @@ void FreeDesktopNotifier::showMessage(Type type, const String& subject, const St return; } + QString body = P2QSTRING(description); + body = body.replace("&", "&"); + body = body.replace("<", "<"); + body = body.replace(">", ">"); + int timeout = (type == IncomingMessage || type == SystemMessage) ? DEFAULT_MESSAGE_NOTIFICATION_TIMEOUT_SECONDS : DEFAULT_STATUS_NOTIFICATION_TIMEOUT_SECONDS; QDBusMessage msg = QDBusMessage::createMethodCall("org.freedesktop.Notifications", "/org/freedesktop/Notifications", "", "Notify"); @@ -42,7 +47,7 @@ void FreeDesktopNotifier::showMessage(Type type, const String& subject, const St msg << quint32(0); // ID of previous notification to replace msg << imageScaler.getScaledImage(picture, 48).string().c_str(); // Icon to display msg << P2QSTRING(subject); // Summary / Header of the message to display - msg << P2QSTRING(description); // Body of the message to display + msg << body; // Body of the message to display msg << actions; // Actions from which the user may choose msg << hints; // Hints to the server displaying the message msg << qint32(timeout*1000); // Timeout in milliseconds |