summary refs log tree commit diff
path: root/webclient/app-controller.js
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-09-01 13:29:17 +0100
committerMark Haines <mark.haines@matrix.org>2014-09-01 13:29:17 +0100
commita9512d0994bba12cd3684d37030ce68ebe9330b3 (patch)
tree6a80e8f1fa89fccf0cd90ea251edb7c1fb28224c /webclient/app-controller.js
parentMerge branch 'develop' into server2server_tls (diff)
parentadd another public wishlist item (diff)
downloadsynapse-a9512d0994bba12cd3684d37030ce68ebe9330b3.tar.xz
Merge branch 'develop' into server2server_tls
Diffstat (limited to 'webclient/app-controller.js')
-rw-r--r--webclient/app-controller.js19
1 files changed, 14 insertions, 5 deletions
diff --git a/webclient/app-controller.js b/webclient/app-controller.js
index 80474bb8df..172770f82f 100644
--- a/webclient/app-controller.js
+++ b/webclient/app-controller.js
@@ -37,6 +37,8 @@ angular.module('MatrixWebClientController', ['matrixService', 'mPresence', 'even
         mPresence.start();
     }
     
+    $scope.user_id = matrixService.config().user_id;
+    
     /**
      * Open a given page.
      * @param {String} url url of the page
@@ -45,6 +47,16 @@ angular.module('MatrixWebClientController', ['matrixService', 'mPresence', 'even
         $location.url(url);
     };
     
+    // Open the given user profile page
+    $scope.goToUserPage = function(user_id) {
+        if (user_id === $scope.user_id) {
+            $location.url("/settings");
+        }
+        else {
+            $location.url("/user/" + user_id);
+        }
+    };
+    
     // Logs the user out 
     $scope.logout = function() {
         
@@ -69,11 +81,8 @@ angular.module('MatrixWebClientController', ['matrixService', 'mPresence', 'even
         $scope.logout();
     });
     
-    $scope.requestNotifications = function() {
-        if (window.Notification) {
-            console.log("Notification.permission: " + window.Notification.permission);
-            window.Notification.requestPermission(function(){});
-        }
+    $scope.updateHeader = function() {
+        $scope.user_id = matrixService.config().user_id;
     };
     
 }]);