Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob][photos] Enable social flag when comments bit is set

Neeraj Gupta540a285c7d3c
diff --git a/mobile/apps/photos/plugins/ente_feature_flag/lib/src/service.dart b/mobile/apps/photos/plugins/ente_feature_flag/lib/src/service.dart
index 72eb5f5acd..63d802c6f7 100644
--- a/mobile/apps/photos/plugins/ente_feature_flag/lib/src/service.dart
+++ b/mobile/apps/photos/plugins/ente_feature_flag/lib/src/service.dart
@@ -13,6 +13,7 @@ import "model.dart";
class FlagService {
static const int _uploadV2Flag = 1 << 0;
+ static const int _commentsFlag = 1 << 1; // Keep in sync with server/ente/remotestore.go
final SharedPreferences _prefs;
final Dio _enteDio;
@@ -64,7 +65,7 @@ class FlagService {
bool get enableMobMultiPart => flags.enableMobMultiPart || internalUser;
- bool get enableUploadV2 => ((flags.serverApiFlag & _uploadV2Flag) != 0);
+ bool get enableUploadV2 => _isServerFlagEnabled(_uploadV2Flag);
bool get enableVectorDb => hasGrantedMLConsent;
@@ -93,7 +94,7 @@ class FlagService {
bool get enableShareePin => true;
- bool get isSocialEnabled => internalUser;
+ bool get isSocialEnabled => internalUser || _isServerFlagEnabled(_commentsFlag);
Future<void> tryRefreshFlags() async {
try {
@@ -167,4 +168,7 @@ class FlagService {
_prefs.setString("remote_flags", flags.toJson());
_fetch().ignore();
}
+
+ bool _isServerFlagEnabled(int flagBit) =>
+ (flags.serverApiFlag & flagBit) != 0;
}