From f9f07063876ec5f3917ce72385b015e1b5f31d7e Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Fri, 26 Apr 2019 23:12:05 +0200 Subject: implement channel discovery refactor muc search to use http cache channel search results --- src/main/java/de/pixart/messenger/utils/AccountUtils.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/main/java/de/pixart/messenger/utils') 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 getEnabledAccounts(final XmppConnectionService service) { + ArrayList 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 accounts = service.getAccounts(); -- cgit v1.2.3