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