aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-04-13 22:01:38 +0200
committerChristian Schneppe <christian@pix-art.de>2018-04-13 22:01:38 +0200
commitdef2ca9e405e048b61f834cc180c79340c638257 (patch)
tree947876ba1cae395a61e37d1368b1c366091d7449
parent8718c2ef2e5590911b4f525fe708fd77c56e17c8 (diff)
do not allow user to quote file
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationFragment.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
index dc64d26b3..c92ca19d3 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
@@ -111,6 +111,7 @@ import de.pixart.messenger.utils.StylingHelper;
import de.pixart.messenger.utils.UIHelper;
import de.pixart.messenger.xmpp.XmppConnection;
import de.pixart.messenger.xmpp.chatstate.ChatState;
+import de.pixart.messenger.xmpp.jingle.JingleConnection;
import in.championswimmer.sfg.lib.SimpleFingerGestures;
import rocks.xmpp.addr.Jid;
@@ -1270,9 +1271,10 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
if (m.getType() != Message.TYPE_STATUS) {
final boolean treatAsFile = m.getType() != Message.TYPE_TEXT
&& m.getType() != Message.TYPE_PRIVATE
- && t == null;
+ && !(t instanceof TransferablePlaceholder);
final boolean encrypted = m.getEncryption() == Message.ENCRYPTION_DECRYPTION_FAILED
|| m.getEncryption() == Message.ENCRYPTION_PGP;
+ final boolean receiving = m.getStatus() == Message.STATUS_RECEIVED && (t instanceof JingleConnection || t instanceof HttpDownloadConnection);
activity.getMenuInflater().inflate(R.menu.message_context, menu);
menu.setHeaderTitle(R.string.message_options);
MenuItem copyMessage = menu.findItem(R.id.copy_message);
@@ -1298,7 +1300,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
&& (m.getConversation().getMucOptions().nonanonymous() || m.getConversation().getMode() == Conversation.MODE_SINGLE)) {
correctMessage.setVisible(true);
}
- if (treatAsFile || (m.getType() == Message.TYPE_TEXT && !m.treatAsDownloadable())) {
+ if ((treatAsFile && !receiving) || (m.getType() == Message.TYPE_TEXT && !m.treatAsDownloadable())) {
shareWith.setVisible(true);
}