aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-06-28 10:34:43 +0200
committerChristian Schneppe <christian@pix-art.de>2016-06-28 14:01:40 +0200
commit8110a3804933d895b7b4156bc052235623fcf2c2 (patch)
treef3f69f176ee5e96d63a769395385d7020d8de739
parent1c620de83d6f501b2c6e75882cdd279f2f861dba (diff)
don't show 'create conference' toast on invite
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationActivity.java7
-rw-r--r--src/main/java/eu/siacs/conversations/ui/XmppActivity.java13
2 files changed, 12 insertions, 8 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
index b05f00ec6..3920adc81 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
@@ -1343,9 +1343,10 @@ public class ConversationActivity extends XmppActivity
}
if (mPendingConferenceInvite != null) {
- mPendingConferenceInvite.execute(this);
- mToast = Toast.makeText(this, R.string.creating_conference,Toast.LENGTH_LONG);
- mToast.show();
+ if (mPendingConferenceInvite.execute(this)) {
+ mToast = Toast.makeText(this, R.string.creating_conference, Toast.LENGTH_LONG);
+ mToast.show();
+ }
mPendingConferenceInvite = null;
}
diff --git a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java
index 602486c05..f38f270d6 100644
--- a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java
@@ -994,9 +994,10 @@ public abstract class XmppActivity extends Activity {
if (requestCode == REQUEST_INVITE_TO_CONVERSATION && resultCode == RESULT_OK) {
mPendingConferenceInvite = ConferenceInvite.parse(data);
if (xmppConnectionServiceBound && mPendingConferenceInvite != null) {
- mPendingConferenceInvite.execute(this);
- mToast = Toast.makeText(this, R.string.creating_conference,Toast.LENGTH_LONG);
- mToast.show();
+ if (mPendingConferenceInvite.execute(this)) {
+ mToast = Toast.makeText(this, R.string.creating_conference, Toast.LENGTH_LONG);
+ mToast.show();
+ }
mPendingConferenceInvite = null;
}
}
@@ -1234,19 +1235,21 @@ public abstract class XmppActivity extends Activity {
return invite;
}
- public void execute(XmppActivity activity) {
+ public boolean execute(XmppActivity activity) {
XmppConnectionService service = activity.xmppConnectionService;
Conversation conversation = service.findConversationByUuid(this.uuid);
if (conversation == null) {
- return;
+ return false;
}
if (conversation.getMode() == Conversation.MODE_MULTI) {
for (Jid jid : jids) {
service.invite(conversation, jid);
}
+ return false;
} else {
jids.add(conversation.getJid().toBareJid());
service.createAdhocConference(conversation.getAccount(), null, jids, activity.adhocCallback);
+ return true;
}
}
}