diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 84681569e..f8e2f0b9f 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -50,12 +50,15 @@ var State = { // These reasons are useful when we destroy the notifications received through // the notification daemon. We use EXPIRED for notifications that we dismiss // and the user did not interact with, DISMISSED for all other notifications -// that were destroyed as a result of a user action, and SOURCE_CLOSED for the -// notifications that were requested to be destroyed by the associated source. +// that were destroyed as a result of a user action, SOURCE_CLOSED for the +// notifications that were requested to be destroyed by the associated source, +// and REPLACED for notifications that were destroyed as a consequence of a +// newer version having replaced them. var NotificationDestroyedReason = { EXPIRED: 1, DISMISSED: 2, - SOURCE_CLOSED: 3 + SOURCE_CLOSED: 3, + REPLACED: 4 }; // Message tray has its custom Urgency enumeration. LOW, NORMAL and CRITICAL diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js index 4d2be44ed..609e56253 100644 --- a/js/ui/notificationDaemon.js +++ b/js/ui/notificationDaemon.js @@ -690,7 +690,7 @@ var GtkNotificationDaemonAppSource = new Lang.Class({ this._notificationPending = true; if (this._notifications[notificationId]) - this._notifications[notificationId].destroy(); + this._notifications[notificationId].destroy(MessageTray.NotificationDestroyedReason.REPLACED); let notification = this._createNotification(notificationParams); notification.connect('destroy', () => {