mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 02:39:05 +01:00
Compare commits
1 Commits
fix-screen
...
2248-featu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8e07414e7 |
@@ -11,6 +11,8 @@ public interface FeatureFlags {
|
||||
|
||||
boolean shouldEnableDisappearingMessages();
|
||||
|
||||
boolean shouldEnableIntroductionsInCore();
|
||||
|
||||
boolean shouldEnablePrivateGroupsInCore();
|
||||
|
||||
boolean shouldEnableForumsInCore();
|
||||
|
||||
@@ -25,6 +25,11 @@ public class TestFeatureFlagModule {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldEnableIntroductionsInCore() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldEnablePrivateGroupsInCore() {
|
||||
return true;
|
||||
|
||||
@@ -340,6 +340,11 @@ public class AppModule {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldEnableIntroductionsInCore() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldEnablePrivateGroupsInCore() {
|
||||
return true;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.briarproject.briar.introduction;
|
||||
|
||||
import org.briarproject.bramble.api.FeatureFlags;
|
||||
import org.briarproject.bramble.api.cleanup.CleanupManager;
|
||||
import org.briarproject.bramble.api.client.ClientHelper;
|
||||
import org.briarproject.bramble.api.contact.ContactManager;
|
||||
@@ -35,12 +36,14 @@ public class IntroductionModule {
|
||||
@Singleton
|
||||
IntroductionValidator provideValidator(ValidationManager validationManager,
|
||||
MessageEncoder messageEncoder, MetadataEncoder metadataEncoder,
|
||||
ClientHelper clientHelper, Clock clock) {
|
||||
ClientHelper clientHelper, Clock clock, FeatureFlags featureFlags) {
|
||||
IntroductionValidator introductionValidator =
|
||||
new IntroductionValidator(messageEncoder, clientHelper,
|
||||
metadataEncoder, clock);
|
||||
validationManager.registerMessageValidator(CLIENT_ID, MAJOR_VERSION,
|
||||
introductionValidator);
|
||||
if (featureFlags.shouldEnableIntroductionsInCore()) {
|
||||
validationManager.registerMessageValidator(CLIENT_ID, MAJOR_VERSION,
|
||||
introductionValidator);
|
||||
}
|
||||
return introductionValidator;
|
||||
}
|
||||
|
||||
@@ -52,7 +55,11 @@ public class IntroductionModule {
|
||||
ConversationManager conversationManager,
|
||||
ClientVersioningManager clientVersioningManager,
|
||||
IntroductionManagerImpl introductionManager,
|
||||
CleanupManager cleanupManager) {
|
||||
CleanupManager cleanupManager,
|
||||
FeatureFlags featureFlags) {
|
||||
if (!featureFlags.shouldEnableIntroductionsInCore()) {
|
||||
return introductionManager;
|
||||
}
|
||||
lifecycleManager.registerOpenDatabaseHook(introductionManager);
|
||||
contactManager.registerContactHook(introductionManager);
|
||||
validationManager.registerIncomingMessageHook(CLIENT_ID,
|
||||
|
||||
@@ -107,6 +107,7 @@ internal class HeadlessModule(private val appDir: File) {
|
||||
override fun shouldEnableImageAttachments() = false
|
||||
override fun shouldEnableProfilePictures() = false
|
||||
override fun shouldEnableDisappearingMessages() = false
|
||||
override fun shouldEnableIntroductionsInCore() = false
|
||||
override fun shouldEnablePrivateGroupsInCore() = false
|
||||
override fun shouldEnableForumsInCore() = true
|
||||
override fun shouldEnableBlogsInCore() = true
|
||||
|
||||
Reference in New Issue
Block a user