Merge pull request #861 from stokito/fix_account_creation

spark-core: separate message when account registration is not allowed
This commit is contained in:
ilyaHlevnoy 2024-08-07 00:21:29 +03:00 committed by GitHub
commit 686fc4a91b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View File

@ -281,11 +281,15 @@ public class AccountCreationWizard extends JPanel {
* @param condition the error code.
*/
private void accountCreationFailed( StanzaError.Condition condition ) {
String message = Res.getString("message.create.account");
String message;
if (condition == StanzaError.Condition.conflict) {
message = Res.getString("message.already.exists");
usernameField.setText("");
usernameField.requestFocus();
} else if (condition == StanzaError.Condition.not_allowed || condition == StanzaError.Condition.forbidden) {
message = Res.getString("message.create.account.not.allowed");
} else {
message = Res.getString("message.create.account");
}
UIManager.put("OptionPane.okButtonText", Res.getString("ok"));
JOptionPane.showMessageDialog(this, message, Res.getString("title.create.problem"), JOptionPane.ERROR_MESSAGE);
@ -293,7 +297,7 @@ public class AccountCreationWizard extends JPanel {
}
/**
* Called if the account was created succesfully.
* Called if the account was created successfully.
*/
private void accountCreationSuccessful() {
registered = true;

View File

@ -480,6 +480,7 @@ message.add.to.roster = Add To roster
message.add.user = Add user to your roster?
message.alert.notify = Alert notification
message.already.exists = Account already exists, please try a different username
message.create.account.not.allowed = Account creation is not allowed on the server
message.approve.subscription = Allow {0} to add you to their roster?
message.authenticating = Authenticating
message.away.idle = Away due to idle