summary refs log tree commit diff
path: root/webclient/app-controller.js
diff options
context:
space:
mode:
authorEmmanuel ROHEE <erohee@amdocs.com>2014-08-26 16:25:27 +0200
committerEmmanuel ROHEE <erohee@amdocs.com>2014-08-26 16:25:27 +0200
commitc21fcb3373b10e85fd2533570479cac6caf5da4e (patch)
treedf474cb84f0470fdc8c5735f81db3fc24ccbacf6 /webclient/app-controller.js
parentMerge branch 'client_server_url_rename' into develop (diff)
downloadsynapse-c21fcb3373b10e85fd2533570479cac6caf5da4e.tar.xz
Determine and send user presence state
Diffstat (limited to 'webclient/app-controller.js')
-rw-r--r--webclient/app-controller.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/webclient/app-controller.js b/webclient/app-controller.js
index 84cb94dc74..f210119e21 100644
--- a/webclient/app-controller.js
+++ b/webclient/app-controller.js
@@ -20,9 +20,9 @@ limitations under the License.
 
 'use strict';
 
-angular.module('MatrixWebClientController', ['matrixService'])
-.controller('MatrixWebClientController', ['$scope', '$location', '$rootScope', 'matrixService', 'eventStreamService',
-                               function($scope, $location, $rootScope, matrixService, eventStreamService) {
+angular.module('MatrixWebClientController', ['matrixService', 'mPresence', 'eventStreamService'])
+.controller('MatrixWebClientController', ['$scope', '$location', '$rootScope', 'matrixService', 'mPresence', 'eventStreamService',
+                               function($scope, $location, $rootScope, matrixService, mPresence, eventStreamService) {
          
     // Check current URL to avoid to display the logout button on the login page
     $scope.location = $location.path();
@@ -34,6 +34,7 @@ angular.module('MatrixWebClientController', ['matrixService'])
 
     if (matrixService.isUserLoggedIn()) {
         // eventStreamService.resume();
+        mPresence.start();
     }
     
     $scope.go = function(url) {
@@ -42,9 +43,13 @@ angular.module('MatrixWebClientController', ['matrixService'])
     
     // Logs the user out 
     $scope.logout = function() {
+        
         // kill the event stream
         eventStreamService.stop();
-    
+
+        // Do not update presence anymore
+        mPresence.stop();
+
         // Clean permanent data
         matrixService.setConfig({});
         matrixService.saveConfig();
@@ -67,7 +72,6 @@ angular.module('MatrixWebClientController', ['matrixService'])
         }
     };
     
-    
 }]);