aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2015-06-28 13:14:21 +0200
committerDaniel Gultsch <daniel@gultsch.de>2015-06-29 15:21:41 +0200
commit7e11570f2c2eeeab17b4c024442bb849b40899df (patch)
tree68a005c26064fad3355f63afcc1737095c0d287e /src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
parent9eb9a522050589e60bc7c76b2b040b1dadb7fd1d (diff)
show attach button in conferences when http upload is available
Diffstat (limited to 'src/main/java/eu/siacs/conversations/ui/ConversationActivity.java')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationActivity.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
index c48b5865..770129ab 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
@@ -35,6 +35,7 @@ import java.util.Iterator;
import java.util.List;
import eu.siacs.conversations.R;
+import eu.siacs.conversations.entities.Account;
import eu.siacs.conversations.entities.Blockable;
import eu.siacs.conversations.entities.Contact;
import eu.siacs.conversations.entities.Conversation;
@@ -382,7 +383,7 @@ public class ConversationActivity extends XmppActivity
}
if (this.getSelectedConversation().getMode() == Conversation.MODE_MULTI) {
menuContactDetails.setVisible(false);
- menuAttach.setVisible(false);
+ menuAttach.setVisible(getSelectedConversation().getAccount().httpUploadAvailable());
menuInviteContact.setVisible(getSelectedConversation().getMucOptions().canInvite());
} else {
menuMucDetails.setVisible(false);
@@ -398,6 +399,8 @@ public class ConversationActivity extends XmppActivity
}
private void selectPresenceToAttachFile(final int attachmentChoice, final int encryption) {
+ final Conversation conversation = getSelectedConversation();
+ final Account account = conversation.getAccount();
final OnPresenceSelected callback = new OnPresenceSelected() {
@Override
@@ -449,11 +452,11 @@ public class ConversationActivity extends XmppActivity
}
}
};
- if (attachmentChoice == ATTACHMENT_CHOICE_LOCATION && encryption != Message.ENCRYPTION_OTR) {
- getSelectedConversation().setNextCounterpart(null);
+ if ((account.httpUploadAvailable() || attachmentChoice == ATTACHMENT_CHOICE_LOCATION) && encryption != Message.ENCRYPTION_OTR) {
+ conversation.setNextCounterpart(null);
callback.onPresenceSelected();
} else {
- selectPresence(getSelectedConversation(),callback);
+ selectPresence(conversation,callback);
}
}