From 208eda8568bfc16681d6fc41e2264b2b55d6f7a8 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Tue, 3 Sep 2019 15:17:14 +1000 Subject: [PATCH] Fix menu option visibility --- .../securesms/conversation/ConversationFragment.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/org/thoughtcrime/securesms/conversation/ConversationFragment.java b/src/org/thoughtcrime/securesms/conversation/ConversationFragment.java index f4320716b5..f9dc3d7ae4 100644 --- a/src/org/thoughtcrime/securesms/conversation/ConversationFragment.java +++ b/src/org/thoughtcrime/securesms/conversation/ConversationFragment.java @@ -405,13 +405,15 @@ public class ConversationFragment extends Fragment } menu.findItem(R.id.menu_context_copy).setVisible(!actionMessage && hasText); - boolean isLokiPublicChat = recipient.isGroupRecipient(); // TODO: Figure out a better way of determining this + boolean isGroupChat = recipient.isGroupRecipient(); // TODO: Figure out a better way of determining this - if (isLokiPublicChat) { + if (isGroupChat) { menu.findItem(R.id.menu_context_reply).setVisible(false); + boolean isDeleteOptionVisible = recipient.getName().equals("Loki Public Chat") && messageRecords.size() == 1; + menu.findItem(R.id.menu_context_delete_message).setVisible(isDeleteOptionVisible); + } else { + menu.findItem(R.id.menu_context_delete_message).setVisible(true); } - - menu.findItem(R.id.menu_context_delete_message).setVisible(true); } private ConversationAdapter getListAdapter() {