Closed kbrenneman closed 4 years ago
It's a fix, not a simplification. After the changes in 960df18a456f5171a2f5e052278df64d6c663989, the hints parameter to the Notify method is broken, because mate-notification-daemon tries to unpack the wrong data types from it. That means clients can't send a notification with sound, icons, urgency levels, and so on.
You can test that like this:
notify-send --hint=string:sound-file:/path/to/some/sound.wav foo bar
Before 960df18a456f5171a2f5e052278df64d6c663989, that would show a notification and play the sound file. Now, it'll show the notification but ignore the sound.
I've added this PR as a patch to mate-notification-daemon 1.22.0-2ubuntu1 in Ubuntu MATE 19.10 and can confirm that it works correctly.
@flexiondotorg You forgot to merge it ot 1.22. https://github.com/mate-desktop/mate-notification-daemon/commit/960df18a456f5171a2f5e052278df64d6c663989 is in 1.22. Please take a look at https://github.com/mate-desktop/mate-notification-daemon/pull/158
mate-notification-daemon uses g_variant_lookup with a format string of "v" to look up everything in the hints dictionary. That only works if the actual value is a GVariant, but it won't decode strings, integers, etc.
This fixes the g_variant_lookup calls to use the correct type strings. In most cases, it'll also now unpack the values directly instead of fetching them in another GVariant.