changeset 12:dfd64db41b8a

make sure both sources and messages get updated when the user unsubscribes
author Myk Melez <myk@mozilla.org>
date Fri, 11 Apr 2008 15:14:49 -0700
parents 40c49a0e9e34
children 8c927c7a7bea
files extension/content/sidebar.js extension/content/view.js
diffstat 2 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/extension/content/sidebar.js	Fri Apr 11 15:08:33 2008 -0700
+++ b/extension/content/sidebar.js	Fri Apr 11 15:14:49 2008 -0700
@@ -116,7 +116,8 @@
       throw ex;
     }
 
-    this._rebuildView();
+    this._obsSvc.notifyObservers(null, "sources:changed", null);
+    this._obsSvc.notifyObservers(null, "messages:changed", null);
   }
 
 };
--- a/extension/content/view.js	Fri Apr 11 15:08:33 2008 -0700
+++ b/extension/content/view.js	Fri Apr 11 15:14:49 2008 -0700
@@ -92,8 +92,13 @@
     throw Cr.NS_ERROR_NO_INTERFACE;
   },
 
-  observe: function(aSubject, aTopic, aData) {
-    this._rebuildView();
+  // nsIObserver
+  observe: function(subject, topic, data) {
+    switch (topic) {
+      case "messages:changed":
+        this._rebuildView();
+        break;
+    }
   },
 
   onUpdate: function() {