diff options
author | sojuz151 <36378873+sojuz151@users.noreply.github.com> | 2021-09-22 15:51:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-22 15:51:54 +0200 |
commit | 1cf10ebdf23dd4ff2c86c8b008859b018c5b39e6 (patch) | |
tree | fa8d7a0d1f47cf227d2918dc66e9d69c05c54074 /main/src | |
parent | 93e2e0d1cf7d6e5a7ccc7f6960d06d93e7e0eb87 (diff) | |
download | dino-1cf10ebdf23dd4ff2c86c8b008859b018c5b39e6.tar.gz dino-1cf10ebdf23dd4ff2c86c8b008859b018c5b39e6.zip |
Small notification fixes (#1077)
Diffstat (limited to 'main/src')
-rw-r--r-- | main/src/ui/notifier_freedesktop.vala | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/main/src/ui/notifier_freedesktop.vala b/main/src/ui/notifier_freedesktop.vala index 78ed2d1e..634f331b 100644 --- a/main/src/ui/notifier_freedesktop.vala +++ b/main/src/ui/notifier_freedesktop.vala @@ -10,6 +10,7 @@ public class Dino.Ui.FreeDesktopNotifier : NotificationProvider, Object { private StreamInteractor stream_interactor; private DBusNotifications dbus_notifications; private bool supports_body_markup = false; + private bool supports_body_hyperlinks = false; private HashMap<Conversation, uint32> content_notifications = new HashMap<Conversation, uint32>(Conversation.hash_func, Conversation.equals_func); private HashMap<Conversation, Gee.List<uint32>> conversation_notifications = new HashMap<Conversation, Gee.List<uint32>>(Conversation.hash_func, Conversation.equals_func); @@ -31,6 +32,9 @@ public class Dino.Ui.FreeDesktopNotifier : NotificationProvider, Object { case "body-markup": supports_body_markup = true; break; + case "body-hyperlinks": + supports_body_hyperlinks = true; + break; } } @@ -65,7 +69,14 @@ public class Dino.Ui.FreeDesktopNotifier : NotificationProvider, Object { } public async void notify_message(Message message, Conversation conversation, string conversation_display_name, string? participant_display_name) { - string body = supports_body_markup ? Markup.escape_text(message.body) : message.body; + string body = ""; + if (supports_body_hyperlinks) { + body = Util.parse_add_markup(message.body, null, true, false); + } else if (supports_body_markup) { + body = Markup.escape_text(message.body); + } else { + body = message.body; + } yield notify_content_item(conversation, conversation_display_name, participant_display_name, body); } @@ -119,6 +130,7 @@ public class Dino.Ui.FreeDesktopNotifier : NotificationProvider, Object { hash_table["image-path"] = "call-start-symbolic"; hash_table["sound-name"] = new Variant.string("phone-incoming-call"); hash_table["urgency"] = new Variant.byte(2); + hash_table["desktop-entry"] = new Variant.string(Dino.Application.get_default().get_application_id()); string[] actions = new string[] {"default", "Open conversation", "reject", _("Reject"), "accept", _("Accept")}; try { uint32 notification_id = dbus_notifications.notify("Dino", 0, "", summary, body, actions, hash_table, 0); @@ -305,4 +317,4 @@ public class Dino.Ui.FreeDesktopNotifier : NotificationProvider, Object { this.func = (owned) func; } } -}
\ No newline at end of file +} |