mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-16 04:39:54 +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 {
|
public interface FeatureFlags {
|
||||||
|
|
||||||
boolean shouldEnableImageAttachments();
|
boolean shouldEnableImageAttachments();
|
||||||
|
|
||||||
boolean shouldEnablePrivateMessageDeletion();
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -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
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user