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 | |
parent | bb9045267393b2a7765d7c121b58c5e7043b525e (diff) |
made muc join easier if muc server is known. added room to key words
Diffstat (limited to 'src')
-rw-r--r-- | src/eu/siacs/conversations/entities/Contact.java | 1 | ||||
-rw-r--r-- | src/eu/siacs/conversations/ui/ContactsActivity.java | 16 | ||||
-rw-r--r-- | src/eu/siacs/conversations/xmpp/XmppConnection.java | 2 |
3 files changed, 17 insertions, 2 deletions
diff --git a/src/eu/siacs/conversations/entities/Contact.java b/src/eu/siacs/conversations/entities/Contact.java index 58f1f135..4ce20782 100644 --- a/src/eu/siacs/conversations/entities/Contact.java +++ b/src/eu/siacs/conversations/entities/Contact.java @@ -139,6 +139,7 @@ public class Contact { } else { return (domainParts[0].equals("conf") || domainParts[0].equals("conference") + || domainParts[0].equals("room") || domainParts[0].equals("muc") || domainParts[0].equals("sala") || domainParts[0] .equals("salas")); 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)) { diff --git a/src/eu/siacs/conversations/xmpp/XmppConnection.java b/src/eu/siacs/conversations/xmpp/XmppConnection.java index 74639d42..4ac61ca7 100644 --- a/src/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/eu/siacs/conversations/xmpp/XmppConnection.java @@ -936,7 +936,7 @@ public class XmppConnection implements Runnable { .iterator(); while (it.hasNext()) { Entry<String, List<String>> pairs = it.next(); - if (pairs.getValue().contains(feature)) { + if (pairs.getValue().contains(feature)&&pairs.getValue().size()==1) { return pairs.getKey(); } it.remove(); |