Merge branch '68-enable-private-message-deletion-in-release-builds' into 'master'

Enable private message deletion in release builds

See merge request briar/briar!1206
This commit is contained in:
Torsten Grote
2020-01-08 14:00:03 +00:00
6 changed files with 5 additions and 42 deletions

View File

@@ -6,6 +6,4 @@ package org.briarproject.bramble.api;
public interface FeatureFlags { public interface FeatureFlags {
boolean shouldEnableImageAttachments(); boolean shouldEnableImageAttachments();
boolean shouldEnablePrivateMessageDeletion();
} }

View File

@@ -18,17 +18,6 @@ public class BrambleCoreIntegrationTestModule {
@Provides @Provides
FeatureFlags provideFeatureFlags() { FeatureFlags provideFeatureFlags() {
return new FeatureFlags() { return () -> true;
@Override
public boolean shouldEnableImageAttachments() {
return true;
}
@Override
public boolean shouldEnablePrivateMessageDeletion() {
return true;
}
};
} }
} }

View File

@@ -235,17 +235,6 @@ public class AppModule {
@Provides @Provides
FeatureFlags provideFeatureFlags() { FeatureFlags provideFeatureFlags() {
return new FeatureFlags() { return () -> IS_DEBUG_BUILD;
@Override
public boolean shouldEnableImageAttachments() {
return IS_DEBUG_BUILD;
}
@Override
public boolean shouldEnablePrivateMessageDeletion() {
return IS_DEBUG_BUILD;
}
};
} }
} }

View File

@@ -270,9 +270,7 @@ public class ConversationActivity extends BriarActivity
ConversationScrollListener scrollListener = ConversationScrollListener scrollListener =
new ConversationScrollListener(adapter, viewModel); new ConversationScrollListener(adapter, viewModel);
list.getRecyclerView().addOnScrollListener(scrollListener); list.getRecyclerView().addOnScrollListener(scrollListener);
if (featureFlags.shouldEnablePrivateMessageDeletion()) { addSelectionTracker();
addSelectionTracker();
}
textInputView = findViewById(R.id.text_input_container); textInputView = findViewById(R.id.text_input_container);
if (featureFlags.shouldEnableImageAttachments()) { if (featureFlags.shouldEnableImageAttachments()) {
@@ -378,11 +376,6 @@ public class ConversationActivity extends BriarActivity
MenuInflater inflater = getMenuInflater(); MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.conversation_actions, menu); inflater.inflate(R.menu.conversation_actions, menu);
// Hide private message deletion action if feature is not enabled
if (!featureFlags.shouldEnablePrivateMessageDeletion()) {
menu.removeItem(R.id.action_delete_all_messages);
}
// enable introduction action if available // enable introduction action if available
observeOnce(viewModel.showIntroductionAction(), this, enable -> { observeOnce(viewModel.showIntroductionAction(), this, enable -> {
if (enable != null && enable) { if (enable != null && enable) {

View File

@@ -96,8 +96,5 @@ internal class HeadlessModule(private val appDir: File) {
internal fun provideObjectMapper() = ObjectMapper() internal fun provideObjectMapper() = ObjectMapper()
@Provides @Provides
internal fun provideFeatureFlags() = object : FeatureFlags { internal fun provideFeatureFlags() = FeatureFlags { false }
override fun shouldEnableImageAttachments() = false
override fun shouldEnablePrivateMessageDeletion() = true
}
} }

View File

@@ -63,8 +63,5 @@ internal class HeadlessTestModule(private val appDir: File) {
internal fun provideObjectMapper() = ObjectMapper() internal fun provideObjectMapper() = ObjectMapper()
@Provides @Provides
internal fun provideFeatureFlags() = object : FeatureFlags { internal fun provideFeatureFlags() = FeatureFlags { false }
override fun shouldEnableImageAttachments() = false
override fun shouldEnablePrivateMessageDeletion() = true
}
} }