Closed gabrielfin closed 8 years ago
It looks amazing! Before merging, I want to go thought all my test cases, just to be sure that everything is fine. Please give me a day to do that.
PS: Button for testing is extremely useful :-)
Works like a charm! Thank you so much for the contribution.
I added the option to customize the notification content (for e-mails only) in Thunderbird. Basically, now there's two prefs, one to customize the title and another for the body of the notification. There you can set a string which may contain any of the following placeholders:
I also added a button to test the notification system (especially useful for this new feature), that uses the currently selected e-mail (in the main window/tab) as example.
Just in case, a few comments for clarification:
I used
gHeaderParser.parseDecodedHeader(message.mime2DecodedAuthor)
to separate sender name from sender email, which seems better than using regex.I split
showNewMessageNotification
intoshowNewRSSNotification
andshowNewEmailNotification
, since now they are completely different. Maybe they could be merged again sometime if we enable notification customization for RSS as well.The
format
function receives a callback because obtaining the body of a message is asynchronous. From that I infer that it's not immediate, therefore I only use it if necessary (i.e. the format string actually contains %b). All the callback hassle inshowNewMessageNotification
andformat
is because of that. Maybe there's a prettier way to do it?