1
0
mirror of https://github.com/moparisthebest/mail synced 2024-11-29 20:32:15 -05:00

show error msg when trying to invite

This commit is contained in:
Tankred Hase 2013-11-11 16:11:06 +01:00
parent 217442c471
commit cfd6eec6d3

View File

@ -81,6 +81,7 @@ define(function(require) {
} }
// set display to insecure while fetching keys // set display to insecure while fetching keys
$scope.toKey = undefined;
displayInsecure(); displayInsecure();
// check if to address is contained in known public keys // check if to address is contained in known public keys
emailDao._keychain.getReceiverPublicKey($scope.to, function(err, key) { emailDao._keychain.getReceiverPublicKey($scope.to, function(err, key) {
@ -91,6 +92,7 @@ define(function(require) {
// compare again since model could have changed during the roundtrip // compare again since model could have changed during the roundtrip
if (key && key.userId === $scope.to) { if (key && key.userId === $scope.to) {
$scope.toKey = key;
displaySecure(); displaySecure();
$scope.$apply(); $scope.$apply();
} }
@ -135,7 +137,17 @@ define(function(require) {
// validate recipients // validate recipients
to = $scope.to.replace(/\s/g, '').split(/[,;]/); to = $scope.to.replace(/\s/g, '').split(/[,;]/);
if (!to || to.length < 1) { if (!to || to.length < 1) {
console.log('Seperate recipients with a comma!'); $scope.onError({
errMsg: 'Seperate recipients with a comma!'
});
return;
}
// only allow secure recipients until invitation is implemented
if (!$scope.toKey) {
$scope.onError({
errMsg: 'Invitations not yet supported!'
});
return; return;
} }