From a1e7388f95fb68b55602202982f984bcdc0a53d9 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Tue, 3 Nov 2020 10:47:31 +0100 Subject: [PATCH] disable forwarding info-messages i cannot see a usecase for forwarding info-messages as "member added", so it might also confuse users when the option is offered at all. as all selected messages are loaded into memory anyway, this was easy to implement. tbh, if we would track the selection by message-ids only and this would have require a larger refactoring or performace issues (imaging 100 messages to be checked on each new selected message), i would not have implemented that now :) i do not think, that sensitive information can be send accidentially this way, even if Bob can forward an info-message as "Alice invited Claire" - it is pretty clear to Bob that he forwards exactly that text. (this is different from adding "Honey" to the group - where "Honey" is an only locally given name for "Dr. Someone" ;) --- .../thoughtcrime/securesms/ConversationFragment.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/org/thoughtcrime/securesms/ConversationFragment.java b/src/org/thoughtcrime/securesms/ConversationFragment.java index 0485a89d6..7e93f066c 100644 --- a/src/org/thoughtcrime/securesms/ConversationFragment.java +++ b/src/org/thoughtcrime/securesms/ConversationFragment.java @@ -347,6 +347,16 @@ public class ConversationFragment extends Fragment boolean showReplyPrivately = chat.isGroup() && !messageRecord.isOutgoing() && canReply; menu.findItem(R.id.menu_context_reply_privately).setVisible(showReplyPrivately); } + + // if one of the selected item cannot be forwarded, disable forwarding. + boolean canForward = true; + for (DcMsg messageRecord : messageRecords) { + if (messageRecord.isInfo()) { + canForward = false; + break; + } + } + menu.findItem(R.id.menu_context_forward).setVisible(canForward); } static boolean canReplyToMsg(DcMsg dcMsg) {