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 {
boolean shouldEnableImageAttachments();
boolean shouldEnablePrivateMessageDeletion();
}

View File

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

View File

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

View File

@@ -270,9 +270,7 @@ public class ConversationActivity extends BriarActivity
ConversationScrollListener scrollListener =
new ConversationScrollListener(adapter, viewModel);
list.getRecyclerView().addOnScrollListener(scrollListener);
if (featureFlags.shouldEnablePrivateMessageDeletion()) {
addSelectionTracker();
}
addSelectionTracker();
textInputView = findViewById(R.id.text_input_container);
if (featureFlags.shouldEnableImageAttachments()) {
@@ -378,11 +376,6 @@ public class ConversationActivity extends BriarActivity
MenuInflater inflater = getMenuInflater();
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
observeOnce(viewModel.showIntroductionAction(), this, enable -> {
if (enable != null && enable) {

View File

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

View File

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