Remove reply from context menu when you can't write

This commit is contained in:
Andrew 2023-05-11 22:59:53 +09:30 committed by GitHub
commit 44cb8fec2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -660,7 +660,8 @@ public final class ConversationReactionOverlay extends FrameLayout {
items.add(new ActionItem(R.attr.menu_select_icon, getContext().getResources().getString(R.string.conversation_context__menu_select), () -> handleActionItemClicked(Action.SELECT), items.add(new ActionItem(R.attr.menu_select_icon, getContext().getResources().getString(R.string.conversation_context__menu_select), () -> handleActionItemClicked(Action.SELECT),
getContext().getResources().getString(R.string.AccessibilityId_select))); getContext().getResources().getString(R.string.AccessibilityId_select)));
// Reply // Reply
if (!message.isPending() && !message.isFailed()) { boolean canWrite = openGroup == null || openGroup.getCanWrite();
if (canWrite && !message.isPending() && !message.isFailed()) {
items.add( items.add(
new ActionItem(R.attr.menu_reply_icon, getContext().getResources().getString(R.string.conversation_context__menu_reply), () -> handleActionItemClicked(Action.REPLY), new ActionItem(R.attr.menu_reply_icon, getContext().getResources().getString(R.string.conversation_context__menu_reply), () -> handleActionItemClicked(Action.REPLY),
getContext().getResources().getString(R.string.AccessibilityId_reply_message)) getContext().getResources().getString(R.string.AccessibilityId_reply_message))