mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 02:39:05 +01:00
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:
@@ -6,6 +6,4 @@ package org.briarproject.bramble.api;
|
||||
public interface FeatureFlags {
|
||||
|
||||
boolean shouldEnableImageAttachments();
|
||||
|
||||
boolean shouldEnablePrivateMessageDeletion();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 }
|
||||
}
|
||||
|
||||
@@ -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 }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user