Skip to content
Snippets Groups Projects
Verified Commit 8858b7dd authored by akwizgran's avatar akwizgran
Browse files

Show disabled menu item if we support feature but contact doesn't.

parent f584041f
No related branches found
No related tags found
1 merge request!1387Don't advertise support for self-destructing messages unless feature flag is enabled
Pipeline #5862 passed
......@@ -373,14 +373,13 @@ public class ConversationActivity extends BriarActivity
// enable alias action if available
observeOnce(viewModel.getContactItem(), this, contact ->
menu.findItem(R.id.action_set_alias).setEnabled(true));
// show auto-delete timer setting only, if contacts supports it
// Show auto-delete menu item if feature is enabled
if (featureFlags.shouldEnableDisappearingMessages()) {
observeOnce(viewModel.getPrivateMessageFormat(), this, format -> {
boolean visible = format == TEXT_IMAGES_AUTO_DELETE;
MenuItem item =
menu.findItem(R.id.action_conversation_settings);
item.setVisible(visible);
});
MenuItem item = menu.findItem(R.id.action_conversation_settings);
item.setVisible(true);
// Enable menu item only if contact supports auto-delete
observeOnce(viewModel.getPrivateMessageFormat(), this, format ->
item.setEnabled(format == TEXT_IMAGES_AUTO_DELETE));
}
return super.onCreateOptionsMenu(menu);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment