Bug #278
Dbus notifications blank if message contains any of: < > &
0%
Description
The notification daemon expects to receive marked up text. Sending it these raw characters < > & causes it to choke on what it sees as invalid markup, and display a notification with a blank body. (XChat also has this issue; they never fixed it.)
A minor annoyance is the notifications always appearing at the location specified in the settings, instead of letting the notification daemon choose where to display it (I have mine set to pop up notifications at top right). It would be nice to have the X and Y position settings optional, and even better, having an option to set the X and Y to wherever the Quassel tray icon happens to be on screen.
The attached patch fixes the blank notifications issue by replacing the offending characters with their HTML entities (< > &) which are correctly decoded and displayed by the notification daemon.
The patch also disables setting the X and Y position hints, disregarding the settings, and letting the daemon decide on position.
Additional information:
The patch is far from optimal. As noted above, there should be options to allow the user to select if the position hints should be sent or not. I don't know anything about the settings system, so I haven't touched it.
Also, Quassel should query the notification daemon about its capabilities, and only send markup if the daemon supports it.
Associated revisions
History
#1 Updated by TerrorBite over 16 years ago
Mantis ate my HTML entities, description should read:
"The attached patch fixes the blank notifications issue by replacing the offending characters with their HTML entities (< > &) which are correctly decoded and displayed by the notification daemon."
#2 Updated by xAFFE about 16 years ago
You can use QT::escape for this.
http://doc.trolltech.com/4.4/qt.html#escape
Also you need to check if the daemon is capable of displaying HTML.
#3 Updated by TerrorBite about 16 years ago
New patch uses Qt:escape() and also makes the "Click Me!" button on the notification work.
#4 Updated by Sputnick about 16 years ago
Fixed in <http://git.quassel-irc.org/?p=quassel.git;a=commit;h=0c498574d2f26bae581bc8f9a01e739e1f9c3872>
Thanks TerrorBite, I used some of that information in here, albeit not your patch as I restructured the whole notification thingy :)
Complete and pimp DesktopNotificationBackend.
You'll need to reset your notification settings, as things have moved around in the
settings files.
Thanks to TerrorBite for providing the patches in BR #278, this information was
very valuable!