mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-16 20:59:54 +01:00
Add feature flag for private message deletion.
This commit is contained in:
@@ -8,4 +8,6 @@ public interface FeatureFlags {
|
|||||||
boolean shouldEnableImageAttachments();
|
boolean shouldEnableImageAttachments();
|
||||||
|
|
||||||
boolean shouldEnableRemoteContacts();
|
boolean shouldEnableRemoteContacts();
|
||||||
|
|
||||||
|
boolean shouldEnablePrivateMessageDeletion();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,11 @@ public class BrambleCoreIntegrationTestModule {
|
|||||||
public boolean shouldEnableRemoteContacts() {
|
public boolean shouldEnableRemoteContacts() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldEnablePrivateMessageDeletion() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -246,6 +246,11 @@ public class AppModule {
|
|||||||
public boolean shouldEnableRemoteContacts() {
|
public boolean shouldEnableRemoteContacts() {
|
||||||
return IS_DEBUG_BUILD;
|
return IS_DEBUG_BUILD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldEnablePrivateMessageDeletion() {
|
||||||
|
return IS_DEBUG_BUILD;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -356,6 +356,11 @@ 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) {
|
||||||
|
|||||||
@@ -99,5 +99,6 @@ internal class HeadlessModule(private val appDir: File) {
|
|||||||
internal fun provideFeatureFlags() = object : FeatureFlags {
|
internal fun provideFeatureFlags() = object : FeatureFlags {
|
||||||
override fun shouldEnableImageAttachments() = false
|
override fun shouldEnableImageAttachments() = false
|
||||||
override fun shouldEnableRemoteContacts() = true
|
override fun shouldEnableRemoteContacts() = true
|
||||||
|
override fun shouldEnablePrivateMessageDeletion() = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,5 +66,6 @@ internal class HeadlessTestModule(private val appDir: File) {
|
|||||||
internal fun provideFeatureFlags() = object : FeatureFlags {
|
internal fun provideFeatureFlags() = object : FeatureFlags {
|
||||||
override fun shouldEnableImageAttachments() = false
|
override fun shouldEnableImageAttachments() = false
|
||||||
override fun shouldEnableRemoteContacts() = true
|
override fun shouldEnableRemoteContacts() = true
|
||||||
|
override fun shouldEnablePrivateMessageDeletion() = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user