From 6f925f61ff69392d1fbc478150de99ecad7ca6f5 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Thu, 14 Aug 2014 16:08:14 +0100 Subject: [PATCH] Auto-correct the username when logging in if there isn't an @ --- webclient/login/login-controller.js | 6 ++++++ 1 file changed, 6 insertions(+) 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