π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Chnaged: hideSharedItems name to archiveSharedItems
Muhammed Ayimene9138c719ee2
diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dartindex 3e13731d1b..6291e10c00 100644--- a/lib/generated/l10n.dart+++ b/lib/generated/l10n.dart@@ -2950,16 +2950,6 @@ class S {);}- /// `Hide Shared Items`- String get hideSharedItems {- return Intl.message(- 'Hide Shared Items',- name: 'hideSharedItems',- desc: '',- args: [],- );- }-/// `{count, plural, one{{count} year ago} other{{count} years ago}}`String yearsAgo(num count) {return Intl.plural(diff --git a/lib/services/collections_service.dart b/lib/services/collections_service.dartindex c17c2f4fff..d87319f69d 100644--- a/lib/services/collections_service.dart+++ b/lib/services/collections_service.dart@@ -222,16 +222,23 @@ class CollectionsService {}Set<int> archivedOrHiddenCollectionIds() {- return _collectionIDToCollections.values- .toList()- .where(- (element) =>- element.hasShareeArchived() ||- element.isHidden() ||- element.isArchived(),- )- .map((e) => e.id)- .toSet();+ final bool archiveIncomingCollections = LocalSettings.instance.archiveSharedItems;+ final int ownerID = _config.getUserID()!;+ final Set<int> result = <int>{};+ for (final collection in _collectionIDToCollections.values) {+ if (collection.isHidden() ||+ collection.isArchived() ||+ collection.hasShareeArchived()) {+ result.add(collection.id);+ continue;+ }+ if (archiveIncomingCollections) {+ if (collection.owner?.id != ownerID) {+ result.add(collection.id);+ }+ }+ }+ return result;}int getCollectionSyncTime(int collectionID) {diff --git a/lib/utils/local_settings.dart b/lib/utils/local_settings.dartindex c4b73e0bdd..d2b26d8978 100644--- a/lib/utils/local_settings.dart+++ b/lib/utils/local_settings.dart@@ -13,7 +13,7 @@ class LocalSettings {static final LocalSettings instance = LocalSettings._privateConstructor();static const kCollectionSortPref = "collection_sort_pref";static const kPhotoGridSize = "photo_grid_size";- static const kHideSharedItems = "hide_shared_items";+ static const kArchiveSharedItems = "archive_shared_items";static const kRateUsShownCount = "rate_us_shown_count";static const kRateUsPromptThreshold = 2;@@ -39,16 +39,16 @@ class LocalSettings {}}- bool get hideSharedItems {- return _prefs.getBool(kHideSharedItems) ?? false;+ bool get archiveSharedItems {+ return _prefs.getBool(kArchiveSharedItems) ?? false;}Future<void> setPhotoGridSize(int value) async {await _prefs.setInt(kPhotoGridSize, value);}- Future<void> setHideSharedItems(bool value) async {- await _prefs.setBool(kHideSharedItems, value);+ Future<void> setArchiveSharedItems(bool value) async {+ await _prefs.setBool(kArchiveSharedItems, value);}int getRateUsShownCount() {