diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-06-12 09:54:19 +0200 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-06-12 09:54:19 +0200 |
commit | e353a1c109f68f212c9fbf76c5186be97c835628 (patch) | |
tree | 8090d1ead58b6310c973f8b588aba17870608660 /src/eu/siacs/conversations/ui | |
parent | bb9045267393b2a7765d7c121b58c5e7043b525e (diff) |
made muc join easier if muc server is known. added room to key words
Diffstat (limited to 'src/eu/siacs/conversations/ui')
-rw-r--r-- | src/eu/siacs/conversations/ui/ContactsActivity.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/eu/siacs/conversations/ui/ContactsActivity.java b/src/eu/siacs/conversations/ui/ContactsActivity.java index f4c8ef0b..9e9952bc 100644 --- a/src/eu/siacs/conversations/ui/ContactsActivity.java +++ b/src/eu/siacs/conversations/ui/ContactsActivity.java @@ -18,6 +18,7 @@ import android.os.Bundle; import android.preference.PreferenceManager; import android.text.Editable; import android.text.TextWatcher; +import android.util.Log; import android.util.SparseBooleanArray; import android.view.ActionMode; import android.view.LayoutInflater; @@ -433,7 +434,9 @@ public class ContactsActivity extends XmppActivity { } public void showIsMucDialogIfNeeded(final Contact clickedContact) { - if (clickedContact.couldBeMuc()) { + if (isMuc(clickedContact)) { + startConversation(clickedContact,clickedContact.getAccount(), true); + } else if (clickedContact.couldBeMuc()) { AlertDialog.Builder dialog = new AlertDialog.Builder(this); dialog.setTitle(getString(R.string.multi_user_conference)); dialog.setMessage(getString(R.string.trying_join_conference)); @@ -459,6 +462,17 @@ public class ContactsActivity extends XmppActivity { false); } } + + private boolean isMuc(Contact contact) { + ArrayList<String> mucServers = new ArrayList<String>(); + for(Account account : accounts) { + if (account.getXmppConnection()!=null) { + mucServers.add(account.getXmppConnection().getMucServer()); + } + } + String server = contact.getJid().split("@")[1]; + return mucServers.contains(server); + } public void startConversation(Contact contact, Account account, boolean muc) { if (!contact.getOption(Contact.Options.IN_ROSTER)&&(!muc)) { |