mkiol / GNotifier

Thunderbird add-on that replaces built-in notifications with the OS native notifications
https://addons.mozilla.org/thunderbird/addon/gnotifier/
GNU General Public License v3.0
165 stars 25 forks source link

Remove 2 second delay if buffering is disabled #174

Closed gabrielfin closed 7 years ago

gabrielfin commented 7 years ago

If you have some other indicator of new messages besides the notification, for example the blue envelope in Ubuntu or TB's sound alert, they both arrive 2 seconds before GNotifier's notification. That's because of notification buffering, but if it's disabled, then that 2 second delay is not really necessary.

About the solution: I had to put a timeout of 1ms because otherwise TB would start behaving erratically. It has something to do with getMessageBody in format, that apparently is not ready yet if called syncronously. The 1ms delay seems to solve it (I've been testing it for a week).

If there's a better way to solve this, feel free to change it.

mkiol commented 7 years ago

Since you tested it and it works, I don't see any problem. Thank you.