show escaped jids when it comes to account selection

This commit is contained in:
Daniel Gultsch 2020-05-18 09:35:35 +02:00
parent df3273a6fc
commit 3ca10b8fa9
6 changed files with 10 additions and 10 deletions

View file

@ -79,7 +79,7 @@ public class BlocklistActivity extends AbstractSearchableListItemActivity implem
getString(R.string.block_jabber_id),
getString(R.string.block),
null,
account.getJid().asBareJid().toString(),
account.getJid().asBareJid().toEscapedString(),
true,
false
);

View file

@ -263,7 +263,7 @@ public class ChannelDiscoveryActivity extends XmppActivity implements MenuItem.O
}
public void joinChannelSearchResult(String selectedAccount, Room result) {
final Jid jid = Config.DOMAIN_LOCK == null ? Jid.of(selectedAccount) : Jid.of(selectedAccount, Config.DOMAIN_LOCK, null);
final Jid jid = Config.DOMAIN_LOCK == null ? Jid.ofEscaped(selectedAccount) : Jid.ofEscaped(selectedAccount, Config.DOMAIN_LOCK, null);
final boolean syncAutoJoin = getBooleanPreference("autojoin", R.bool.autojoin);
final Account account = xmppConnectionService.findAccountByJid(jid);
final Conversation conversation = xmppConnectionService.findOrCreateConversation(account, result.getRoom(), true, true, true);

View file

@ -361,9 +361,9 @@ public class ChooseContactActivity extends AbstractSearchableListItemActivity im
for (Account account : xmppConnectionService.getAccounts()) {
if (account.getStatus() != Account.State.DISABLED) {
if (Config.DOMAIN_LOCK != null) {
this.mActivatedAccounts.add(account.getJid().getLocal());
this.mActivatedAccounts.add(account.getJid().getEscapedLocal());
} else {
this.mActivatedAccounts.add(account.getJid().asBareJid().toString());
this.mActivatedAccounts.add(account.getJid().asBareJid().toEscapedString());
}
}
}

View file

@ -146,9 +146,9 @@ public class EnterJidDialog extends DialogFragment implements OnBackendConnected
}
try {
if (Config.DOMAIN_LOCK != null) {
accountJid = Jid.of((String) binding.account.getSelectedItem(), Config.DOMAIN_LOCK, null);
accountJid = Jid.ofEscaped((String) binding.account.getSelectedItem(), Config.DOMAIN_LOCK, null);
} else {
accountJid = Jid.of((String) binding.account.getSelectedItem());
accountJid = Jid.ofEscaped((String) binding.account.getSelectedItem());
}
} catch (final IllegalArgumentException e) {
return;

View file

@ -577,9 +577,9 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
Jid jid;
try {
if (Config.DOMAIN_LOCK != null) {
jid = Jid.of((String) spinner.getSelectedItem(), Config.DOMAIN_LOCK, null);
jid = Jid.ofEscaped((String) spinner.getSelectedItem(), Config.DOMAIN_LOCK, null);
} else {
jid = Jid.of((String) spinner.getSelectedItem());
jid = Jid.ofEscaped((String) spinner.getSelectedItem());
}
} catch (final IllegalArgumentException e) {
return null;

View file

@ -39,9 +39,9 @@ public class AccountUtils {
for (Account account : service.getAccounts()) {
if (account.getStatus() != Account.State.DISABLED) {
if (Config.DOMAIN_LOCK != null) {
accounts.add(account.getJid().getLocal());
accounts.add(account.getJid().toEscapedString());
} else {
accounts.add(account.getJid().asBareJid().toString());
accounts.add(account.getJid().asBareJid().toEscapedString());
}
}
}