Skip to content
Snippets Groups Projects
Commit 6f925f61 authored by Kegan Dougal's avatar Kegan Dougal
Browse files

Auto-correct the username when logging in if there isn't an @

parent 657ab9ba
No related branches found
No related tags found
No related merge requests found
...@@ -68,6 +68,12 @@ angular.module('LoginController', ['matrixService']) ...@@ -68,6 +68,12 @@ angular.module('LoginController', ['matrixService'])
}; };
$scope.login = function() { $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({ matrixService.setConfig({
homeserver: $scope.account.homeserver, homeserver: $scope.account.homeserver,
user_id: $scope.account.user_id user_id: $scope.account.user_id
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment