diff options
author | Christian Schneppe <christian@pix-art.de> | 2019-04-26 23:12:05 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2019-04-26 23:12:22 +0200 |
commit | f9f07063876ec5f3917ce72385b015e1b5f31d7e (patch) | |
tree | 093f9ded3021800b20e1e8dcb22d4d8ac17dc7db /src/main/java/de/pixart/messenger/utils | |
parent | 35276c6519afa1da6042dd485ddae09b06c68aeb (diff) |
implement channel discovery
refactor muc search to use http
cache channel search results
Diffstat (limited to 'src/main/java/de/pixart/messenger/utils')
-rw-r--r-- | src/main/java/de/pixart/messenger/utils/AccountUtils.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/utils/AccountUtils.java b/src/main/java/de/pixart/messenger/utils/AccountUtils.java index d675ed680..593d3a089 100644 --- a/src/main/java/de/pixart/messenger/utils/AccountUtils.java +++ b/src/main/java/de/pixart/messenger/utils/AccountUtils.java @@ -4,8 +4,10 @@ import android.app.Activity; import android.content.Intent; import android.widget.Toast; +import java.util.ArrayList; import java.util.List; +import de.pixart.messenger.Config; import de.pixart.messenger.R; import de.pixart.messenger.entities.Account; import de.pixart.messenger.services.XmppConnectionService; @@ -18,6 +20,19 @@ public class AccountUtils { MANAGE_ACCOUNT_ACTIVITY = getManageAccountActivityClass(); } + public static List<String> getEnabledAccounts(final XmppConnectionService service) { + ArrayList<String> accounts = new ArrayList<>(); + for (Account account : service.getAccounts()) { + if (account.getStatus() != Account.State.DISABLED) { + if (Config.DOMAIN_LOCK != null) { + accounts.add(account.getJid().getLocal()); + } else { + accounts.add(account.getJid().asBareJid().toString()); + } + } + } + return accounts; + } public static Account getFirstEnabled(XmppConnectionService service) { final List<Account> accounts = service.getAccounts(); |