aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/de/pixart/messenger/services/XmppConnectionService.java9
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationActivity.java1
-rw-r--r--src/main/java/de/pixart/messenger/ui/StartConversationActivity.java7
-rw-r--r--src/main/java/de/pixart/messenger/ui/XmppActivity.java3
4 files changed, 12 insertions, 8 deletions
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
index 752e65cfb..bae703b59 100644
--- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
+++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
@@ -2484,7 +2484,7 @@ public class XmppConnectionService extends Service {
}
}
- private String findConferenceServer(final Account account) {
+ public String findConferenceServer(final Account account) {
String server;
if (account.getXmppConnection() != null) {
server = account.getXmppConnection().getMucServer();
@@ -2503,7 +2503,7 @@ public class XmppConnectionService extends Service {
return null;
}
- public void createAdhocConference(final Account account,
+ public boolean createAdhocConference(final Account account,
final String subject,
final Iterable<Jid> jids,
final UiCallback<Conversation> callback) {
@@ -2515,7 +2515,7 @@ public class XmppConnectionService extends Service {
if (callback != null) {
callback.error(R.string.no_conference_server_found, null);
}
- return;
+ return false;
}
final Jid jid = Jid.fromParts(new BigInteger(64, getRNG()).toString(Character.MAX_RADIX), server, null);
final Conversation conversation = findOrCreateConversation(account, jid, true);
@@ -2550,15 +2550,18 @@ public class XmppConnectionService extends Service {
});
}
});
+ return true;
} catch (InvalidJidException e) {
if (callback != null) {
callback.error(R.string.conference_creation_failed, null);
}
+ return true;
}
} else {
if (callback != null) {
callback.error(R.string.not_connected_try_again, null);
}
+ return true;
}
}
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
index 6bcf9c631..8a1076ab5 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
@@ -547,6 +547,7 @@ public class ConversationActivity extends XmppActivity
menuSecure.setVisible((Config.supportOpenPgp() || Config.supportOmemo()) && Config.multipleEncryptionChoices()); //only if pgp is supported we have a choice
} else {
menuSecure.setVisible(Config.multipleEncryptionChoices());
+ menuInviteContact.setVisible(xmppConnectionService != null && xmppConnectionService.findConferenceServer(getSelectedConversation().getAccount()) != null);
}
}
}
diff --git a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
index 2d24a27c9..a301a9127 100644
--- a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
@@ -718,9 +718,10 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
}
}
if (account != null && jids.size() > 0) {
- xmppConnectionService.createAdhocConference(account, subject, jids, mAdhocConferenceCallback);
- mToast = Toast.makeText(this, R.string.creating_conference, Toast.LENGTH_LONG);
- mToast.show();
+ if (xmppConnectionService.createAdhocConference(account, subject, jids, mAdhocConferenceCallback)) {
+ mToast = Toast.makeText(this, R.string.creating_conference, Toast.LENGTH_LONG);
+ mToast.show();
+ }
}
}
} else {
diff --git a/src/main/java/de/pixart/messenger/ui/XmppActivity.java b/src/main/java/de/pixart/messenger/ui/XmppActivity.java
index 31d976584..6f8e98002 100644
--- a/src/main/java/de/pixart/messenger/ui/XmppActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/XmppActivity.java
@@ -1150,8 +1150,7 @@ public abstract class XmppActivity extends Activity {
return false;
} else {
jids.add(conversation.getJid().toBareJid());
- service.createAdhocConference(conversation.getAccount(), null, jids, activity.adhocCallback);
- return true;
+ return service.createAdhocConference(conversation.getAccount(), null, jids, activity.adhocCallback);
}
}
}