summary refs log tree commit diff
path: root/webclient/recents/recents-controller.js
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-09-08 13:54:09 -0700
committerKegan Dougal <kegan@matrix.org>2014-09-08 13:54:09 -0700
commitda9b7b03688e40c0ed5b14ab0e33fb77b6d8b931 (patch)
tree65ceb0a411e4a8bfb9736585b5c8b115fa07ef87 /webclient/recents/recents-controller.js
parentFloat right the num users, apply room highlight to user count. (diff)
downloadsynapse-da9b7b03688e40c0ed5b14ab0e33fb77b6d8b931.tar.xz
Added big massive TODOs on a huge design problem with initial sync
Diffstat (limited to 'webclient/recents/recents-controller.js')
-rw-r--r--webclient/recents/recents-controller.js19
1 files changed, 18 insertions, 1 deletions
diff --git a/webclient/recents/recents-controller.js b/webclient/recents/recents-controller.js
index fcb203b36c..b4762acd1d 100644
--- a/webclient/recents/recents-controller.js
+++ b/webclient/recents/recents-controller.js
@@ -16,6 +16,12 @@
 
 'use strict';
 
+// XXX FIXME TODO
+// We should NOT be dumping things into $rootScope!!!! We should NOT be
+// making any requests here, and should READ what is already in the 
+// rootScope from the event handler service!!!
+// XXX FIXME TODO
+
 angular.module('RecentsController', ['matrixService', 'matrixFilter', 'eventHandlerService'])
 .controller('RecentsController', ['$rootScope', '$scope', 'matrixService', 'eventHandlerService', 
                                function($rootScope, $scope, matrixService, eventHandlerService) {
@@ -28,6 +34,11 @@ angular.module('RecentsController', ['matrixService', 'matrixFilter', 'eventHand
     // in order to highlight a specific room in the list
     $rootScope.recentsSelectedRoomID;
 
+    // XXX FIXME TODO : We should NOT be doing this here, which could be
+    // repeated for every controller instance. We should be doing this in
+    // event handler service instead. In additon, this will break if there
+    // isn't a recents controller visible when the last message comes in :/
+    
     var listenToEventStream = function() {
         // Refresh the list on matrix invitation and message event
         $rootScope.$on(eventHandlerService.MEMBER_EVENT, function(ngEvent, event, isLive) {
@@ -58,7 +69,13 @@ angular.module('RecentsController', ['matrixService', 'matrixFilter', 'eventHand
         if ($rootScope.rooms) {
             return;
         }
-
+        
+        // XXX FIXME TODO
+        // We should NOT be dumping things into $rootScope!!!! We should NOT be
+        // making any requests here, and should READ what is already in the 
+        // rootScope from the event handler service!!!
+        // XXX FIXME TODO
+        
         $rootScope.rooms = {};
         
         // Use initialSync data to init the recents list