From def2ca9e405e048b61f834cc180c79340c638257 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Fri, 13 Apr 2018 22:01:38 +0200 Subject: do not allow user to quote file --- src/main/java/de/pixart/messenger/ui/ConversationFragment.java | 6 ++++-- 1 file 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); } -- cgit v1.2.3