summary refs log tree commit diff
path: root/webclient
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-08-14 16:08:14 +0100
committerKegan Dougal <kegan@matrix.org>2014-08-14 16:08:22 +0100
commit6f925f61ff69392d1fbc478150de99ecad7ca6f5 (patch)
tree550711c1b4238d788af6755250b78ebaf37d2fa1 /webclient
parentPut some DEBUG logging in lockutils.py so we can debug roomlocks (diff)
downloadsynapse-6f925f61ff69392d1fbc478150de99ecad7ca6f5.tar.xz
Auto-correct the username when logging in if there isn't an @
Diffstat (limited to '')
-rw-r--r--webclient/login/login-controller.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/webclient/login/login-controller.js b/webclient/login/login-controller.js
index 53756be9ea..826a533873 100644
--- a/webclient/login/login-controller.js
+++ b/webclient/login/login-controller.js
@@ -68,6 +68,12 @@ angular.module('LoginController', ['matrixService'])
     };
 
     $scope.login = function() {
+        if ($scope.account.user_id.indexOf("@") !== 0) {
+            // technically should be the host of account.homeserver
+            $scope.account.user_id = "@" + $scope.account.user_id + ":" + 
+                                     $location.host()
+        }
+    
         matrixService.setConfig({
             homeserver: $scope.account.homeserver,
             user_id: $scope.account.user_id