Previously, we switched to not updating the notification popup on a
removal, since this usually respawns a new notification popup
unexpectedly. However, when the last relevant notification is cleared
(ie, by opening/reading the thread before the notification times out and
disappears on its own) we should clear the existing popup if there is
one.
// FREEBIE
Previously, notifications were persistent until explicitly dismissed
from the notification center (a bell icon in the system tray), but that
ui has been removed from chrome*, so now updating on remove is
unexpectedly creating a new notification pop up.
*http://blog.chromium.org/2015/10/streamlining-notifications-on-desktop.htmlFixes#667
// FREEBIE
Previous commit removed notification models from the global collection
but did not actually update the existing notification.
This commit refactors the notification interface to allow us to update
it without re-surfacing the notifcation onscreen.
// FREEBIE
Only allow one notification at a time. Use a basic notification for
normal messages, and image notification for image messages, and a list
notification when there are multiple unread messages.
// FREEBIE
Add window.storage to the background page, which loads all data from the
'items' store in indexeddb, caching them in memory for synchronous
access, then override textsecure storage to use that in memory store.