aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/ui/ContactsActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/eu/siacs/conversations/ui/ContactsActivity.java')
-rw-r--r--src/eu/siacs/conversations/ui/ContactsActivity.java16
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)) {