diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-06-28 10:34:43 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2016-06-28 10:34:43 +0200 |
commit | b5caa8fa356d362d1ce30c23de20b656235a0b91 (patch) | |
tree | f31b217c0bd985acf281691887a6dbebe6edca43 /src/main/java/eu | |
parent | 8882c6b6fdb81ca207cdc9a481e18c79b34e7f95 (diff) |
don't show 'create conference' toast on invite
Diffstat (limited to 'src/main/java/eu')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/ConversationActivity.java | 7 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/XmppActivity.java | 13 |
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 0ed35049..4744e302 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -1121,9 +1121,10 @@ public class ConversationActivity extends XmppActivity updateConversationList(); 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 8955278b..3f2308e1 100644 --- a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java @@ -981,9 +981,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; } } @@ -1218,19 +1219,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; } } } |