From f72388a55937c573cab998931f10eb90b37253f2 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 26 Sep 2026 20:56:07 +0000 Subject: [PATCH] refactor: rename packages, helpers and app code after the NIP event renames Follow-up to the event class renames: the names around those classes now match too. Quartz (published API, every old name kept as a @Deprecated alias/forwarder): - nip51Lists packages moved: followList -> starterPack, hashtagList -> interestList, peopleList -> followSet, labeledBookmarkList -> bookmarkSet. The old packages keep a Deprecated.kt with typealiases and forwarding extension functions (ReplaceWith points at the new package). - LnZapPrivateEvent -> PrivateZapEvent, LnZapReceiptValidator -> ZapReceiptValidator, ChannelListDiff -> PublicChatListDiff, HashtagListDiff -> InterestListDiff. - Kind 30063 now indexes NIP-82 release notes for search (never NIP-51 content, which can hold encrypted private items). searchable-events docs updated. App code (amethyst, commons, desktopApp, cli; no aliases needed): - model packages nip51Lists.{hashtagLists,peopleList,labeledBookmarkLists,relayFeeds} -> {interestLists,followSets,bookmarkSets,favoriteRelays}. - State/cache/UI names derived from the old event names: HashtagListState -> InterestListState, PeopleListsState -> FollowSetsState, FollowListsState -> StarterPacksState, LabeledBookmarkList -> BookmarkSet, RelayFeedListState -> FavoriteRelayListState, ContactCardsState -> UserAssertionsState, NIP90* view models/renderers -> Dvm*, LnZap* handlers -> Zap*, SealedRumor* -> Seal*, and Account.peopleLists/followLists/hashtagList -> followSets/starterPacks/interestList. - String literals were left untouched, so preference keys and @SerialName values stored on disk are unchanged. - The generic PeopleList UI model (shared by follow sets and starter packs) and the EmojiPackSelection route (which shows a kind 30030 pack) keep their names. Docs: plans, brainstorms, changelogs, skills and READMEs use the new names. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_015VvJ8XpeYqBe8bYT3bJ7UD --- .claude/skills/account-state/SKILL.md | 4 +- .../references/account-state-flow.md | 10 +-- .../skills/nip85-trusted-assertions/SKILL.md | 8 +- .claude/skills/searchable-events/SKILL.md | 7 +- .../references/searchable-kinds.md | 18 ++-- ...2026-07-01-auth-permission-architecture.md | 4 +- .../plans/2026-07-07-nip29-armada-study.md | 12 +-- .../2026-07-13-chat-scroll-performance.md | 2 +- .../2026-07-15-bitchat-geohash-interop.md | 2 +- .../2026-07-23-push-notification-redesign.md | 6 +- amethyst/plans/2026-07-24-nwc-bolt12-pay.md | 2 +- ...2026-07-31-shortpost-notify-list-picker.md | 6 +- .../2026-09-10-dvm-heartbeat-liveness-plan.md | 4 +- .../2026-09-10-dvm-heartbeat-liveness.md | 2 +- .../plans/2026-09-17-nip-cc-geocaching.md | 2 +- .../plans/archive/2026-05-14-onchain-zaps.md | 6 +- .../2026-06-22-napplet-nsite-security.md | 2 +- .../amethyst/LocalPreferences.kt | 32 +++---- .../vitorpamplona/amethyst/model/Account.kt | 82 ++++++++--------- .../amethyst/model/AccountSettings.kt | 40 ++++----- .../amethyst/model/EventBroadcaster.kt | 2 +- .../BookmarkSetsState.kt} | 84 ++++++++--------- .../FavoriteRelayListState.kt} | 50 +++++------ .../FollowSetsState.kt} | 18 ++-- .../StarterPacksState.kt} | 36 ++++---- .../InterestListState.kt} | 34 +++---- .../preferences/AccountPreferenceStores.kt | 4 +- .../serverList/MergedFollowListsState.kt | 30 +++---- .../notifications/NotificationDispatcher.kt | 6 +- .../notifications/PushWrapDecryptor.kt | 2 +- .../FilterAccountInfoAndListsFromKey.kt | 6 +- .../reqCommand/user/UserObservers.kt | 38 ++++---- .../resourceusage/MeteringNostrSigner.kt | 4 +- .../amethyst/ui/dal/FilterByListParams.kt | 2 +- .../amethyst/ui/feeds/PrefetchFeedMedia.kt | 4 +- .../ui/navigation/drawer/DrawerContent.kt | 4 +- .../ui/navigation/routes/RouteMaker.kt | 2 +- .../amethyst/ui/note/MultiSetCompose.kt | 4 +- .../amethyst/ui/note/NoteCompose.kt | 40 ++++----- .../amethyst/ui/note/NoteQuickActionMenu.kt | 4 +- .../ui/note/UpdateReactionTypeDialog.kt | 2 +- .../amethyst/ui/note/UserProfilePicture.kt | 4 +- .../ui/note/creators/notify/AudienceSheet.kt | 6 +- .../amethyst/ui/note/elements/DropDownMenu.kt | 4 +- .../ui/note/types/ActivityCardPreviews.kt | 10 +-- .../amethyst/ui/note/types/Emoji.kt | 2 +- .../amethyst/ui/note/types/FileHeader.kt | 8 +- .../types/NIP90ContentDiscoveryResponse.kt | 2 +- .../amethyst/ui/note/types/NIP90Status.kt | 2 +- .../amethyst/ui/note/types/PeopleList.kt | 2 +- .../amethyst/ui/note/types/ProfileCard.kt | 4 +- .../amethyst/ui/note/types/RelayList.kt | 6 +- .../types/{FollowList.kt => StarterPack.kt} | 4 +- .../amethyst/ui/note/types/Wiki.kt | 4 +- .../amethyst/ui/note/types/ZapEvent.kt | 6 +- .../ui/note/types/lists/BookmarkLists.kt | 4 +- .../amethyst/ui/note/types/lists/TagLists.kt | 4 +- .../ui/screen/AccountSessionManager.kt | 8 +- .../amethyst/ui/screen/TopNavFilterState.kt | 20 ++--- .../ui/screen/loggedIn/AccountViewModel.kt | 6 +- .../loggedIn/DecryptAndIndexProcessor.kt | 22 ++--- .../loggedIn/backups/BackupConflictCards.kt | 14 +-- .../backups/BackupConflictListViews.kt | 12 +-- .../backups/BackupConflictPresentation.kt | 12 +-- .../backups/BackupConflictReviewScreen.kt | 8 +- .../display/BookmarkGroupScreen.kt | 2 +- .../display/BookmarkGroupViewModel.kt | 14 +-- .../list/ListOfBookmarkGroupsScreen.kt | 18 ++-- .../BookmarkGroupMetadataViewModel.kt | 10 +-- .../ArticleBookmarkListManagementScreen.kt | 10 +-- .../PostBookmarkListManagementScreen.kt | 10 +-- .../relayGroup/RelayGroupDiscoveryScreen.kt | 4 +- .../relayGroup/RelayGroupMembersScreen.kt | 2 +- .../RelayGroupsDiscoverySubAssembler.kt | 4 +- .../loggedIn/discover/ChannelCardCompose.kt | 2 +- .../loggedIn/discover/DiscoverScreen.kt | 2 +- .../DiscoverFollowSetsFeedFilter.kt | 2 +- .../discover/nip51FollowSets/FollowSetCard.kt | 2 +- .../dvms/DvmContentDiscoveryScreen.kt | 12 +-- ...kt => DvmContentDiscoveryFeedViewModel.kt} | 6 +- ...t => DvmContentDiscoveryResponseFilter.kt} | 2 +- .../emojipacks/list/ListOfEmojiPacksScreen.kt | 2 +- .../EmojiPackSelectionScreen.kt | 2 +- .../membershipManagement/MyEmojiListScreen.kt | 2 +- .../followPacks/feed/FollowPackFeedScreen.kt | 2 +- .../FollowPackFeedConversationsFeedFilter.kt | 2 +- .../dal/FollowPackFeedNewThreadFeedFilter.kt | 2 +- .../feed/dal/FollowPackMembersFeedFilter.kt | 2 +- .../FollowPackFeedFilterSubAssembler.kt | 2 +- .../followPacks/list/FollowPacksFeedLoaded.kt | 2 +- .../followPacks/list/FollowPacksTopBar.kt | 2 +- .../display/lists/PeopleListViewModel.kt | 12 +-- .../display/packs/FollowPackViewModel.kt | 12 +-- .../lists/list/FollowPackViewModel.kt | 8 +- .../lists/list/PeopleListViewModel.kt | 8 +- .../metadata/FollowPackMetadataViewModel.kt | 8 +- .../metadata/PeopleListMetadataViewModel.kt | 8 +- .../FollowListAndPackAndUserView.kt | 12 +-- .../profile/followers/FollowersTabHeader.kt | 4 +- .../profile/header/UserNicknameCard.kt | 4 +- .../profile/header/UserProfileDropDownMenu.kt | 4 +- .../loggedIn/relays/AllRelayListScreen.kt | 6 +- .../screen/loggedIn/relays/KindDisplayName.kt | 12 +-- ...Model.kt => FavoriteRelayListViewModel.kt} | 6 +- .../relays/feeds/RelayFeedsListView.kt | 6 +- .../loggedIn/threadview/ThreadFeedView.kt | 20 ++--- ...dCompose.kt => FileMetadataCardCompose.kt} | 16 ++-- .../ui/screen/loggedIn/video/VideoScreen.kt | 2 +- .../resourceusage/ResourceUsageLedgerTest.kt | 4 +- cli/plans/archive/2026-04-23-nip17-dm.md | 6 +- commons/plans/2026-05-04-custom-feeds-plan.md | 6 +- .../2026-08-30-commons-migration-sweep.md | 4 +- .../commons/account/AccountBootstrapEvents.kt | 12 +-- .../backups/ReplaceableBackupConflict.kt | 2 +- .../commons/model/cache/EventCache.kt | 28 +++--- .../nip28PublicChats/PublicChatListState.kt | 28 +++--- .../nip29RelayGroups/RelayGroupChannel.kt | 14 +-- .../model/nip30CustomEmojis/EmojiPackState.kt | 18 ++-- .../blockPeopleList/BlockPeopleListState.kt | 6 +- .../BookmarkSet.kt} | 4 +- .../FavoriteRelayListDecryptionCache.kt} | 4 +- .../FollowSetDecryptionCache.kt} | 6 +- .../{peopleList => followSets}/PeopleList.kt | 2 +- .../InterestListDecryptionCache.kt} | 8 +- ...che.kt => UserAssertionDecryptionCache.kt} | 2 +- ...ctCardsState.kt => UserAssertionsState.kt} | 4 +- .../model/topNavFeeds/FeedDecryptionCaches.kt | 8 +- .../topNavFeeds/noteBased/NoteFeedFlow.kt | 6 +- .../notifications/NotificationKinds.kt | 2 +- .../FilterBasicAccountInfoFromKeys.kt | 2 +- .../FilterBookmarksAndReportsFromKey.kt | 2 +- .../metadata/FilterFollowsAndMutesFromKey.kt | 4 +- .../assemblers/ContactCardFilters.kt | 10 +-- .../FilterFollowSetsByAllCommunities.kt | 2 +- .../FilterFollowSetsByAuthors.kt | 2 +- .../FilterFollowSetsByCommunity.kt | 2 +- .../FilterFollowSetsByGeohash.kt | 2 +- .../FilterFollowSetsByHashtag.kt | 2 +- .../nip51FollowSets/FilterFollowSetsGlobal.kt | 2 +- .../profile/FilterUserProfileLists.kt | 6 +- .../user/watchers/UserCardsSubAssembler.kt | 6 +- .../amethyst/commons/search/KindRegistry.kt | 2 +- .../commons/search/RenderableKinds.kt | 4 +- .../model/privateChats/ChatPreviewTest.kt | 14 +-- .../notifications/NotificationKindsTest.kt | 10 +-- .../commons/napplet/NappletBrokerTest.kt | 4 +- .../commons/onchain/OnchainZapSenderTest.kt | 4 +- .../commons/viewmodels/NestViewModelTest.kt | 4 +- .../nip51Lists/ui/BookmarkGroupItem.kt | 4 +- .../ui/ListOfBookmarkGroupsFeedView.kt | 14 +-- .../commons/nip51Lists/ui/PeopleListItem.kt | 2 +- .../ui/EditNicknameDialog.kt | 12 +-- ...sktop-wallet-zapping-test-coverage-plan.md | 16 ++-- ...-23-feat-desktop-moderation-safety-plan.md | 10 +-- ...07-27-feat-desktop-profile-actions-plan.md | 34 +++---- ...-07-27-feat-desktop-profile-parity-plan.md | 24 ++--- ...26-07-27-feat-desktop-profile-tabs-plan.md | 2 +- ...ta-loading-upstream-reconciliation-plan.md | 2 +- .../2026-05-09-embedded-local-relay-plan.md | 2 +- .../2026-05-11-wallet-zapping-brainstorm.md | 2 +- .../desktop/cache/DesktopLocalCache.kt | 14 +-- .../desktop/followpacks/BulkFollowAction.kt | 2 +- .../desktop/followpacks/FollowPackEditor.kt | 2 +- .../desktop/followpacks/FollowPacksState.kt | 2 +- .../desktop/followpacks/ui/DiscoverScreen.kt | 2 +- .../followpacks/ui/FollowAllConfirmDialog.kt | 2 +- .../ui/FollowPackBrowseAllScreen.kt | 2 +- .../followpacks/ui/FollowPackComponents.kt | 2 +- .../followpacks/ui/FollowPackDetailScreen.kt | 2 +- .../followpacks/ui/RenderFollowPackCard.kt | 2 +- .../desktop/model/DesktopHiddenUsersState.kt | 8 +- .../amethyst/desktop/ui/UserProfileScreen.kt | 2 +- .../desktop/ui/note/DesktopRichText.kt | 2 +- docs/TODO.md | 2 +- .../2026-03-16-desktop-media-brainstorm.md | 2 +- ...26-03-19-dm-encryption-badge-brainstorm.md | 2 +- docs/changelog/v0.31.04.md | 2 +- docs/changelog/v0.76.01.md | 2 +- docs/changelog/v1.03.00.md | 2 +- docs/changelog/v1.12.00.md | 2 +- docs/changelog/v1.12.02.md | 2 +- ...-06-10-feat-desktop-dm-reliability-plan.md | 4 +- ...sktop-cache-navigation-persistence-plan.md | 6 +- ...clean-cache-single-source-of-truth-plan.md | 10 +-- ...3-24-feat-article-highlights-notes-plan.md | 6 +- ...026-04-21-feat-relay-config-parity-plan.md | 8 +- ...-21-feat-relay-subscription-wiring-plan.md | 2 +- ...-22-feat-relay-subscription-wiring-plan.md | 4 +- ...feat-desktop-multi-account-support-plan.md | 2 +- ...fix-bunker-timeouts-and-decryption-plan.md | 4 +- ...22-feat-desktop-note-action-bar-ux-plan.md | 2 +- ...2-fix-desktop-feed-review-findings-plan.md | 6 +- .../2026-06-12-giftwrap-deletion-requests.md | 2 +- .../plans/2026-07-11-concord-event-classes.md | 4 +- quartz/plans/archive/2026-06-09-clink.md | 4 +- ...entTest.kt => NwcRequestNip44EventTest.kt} | 2 +- .../nip55AndroidSigner/api/SignerResult.kt | 4 +- .../api/background/queries/DecryptZapQuery.kt | 4 +- .../intents/responses/DecryptZapResponse.kt | 6 +- .../client/NostrSignerExternal.kt | 4 +- .../vitorpamplona/quartz/kinds/KindNames.kt | 12 +-- .../quartz/marmot/MarmotInboundProcessor.kt | 2 +- .../marmot/mip02Welcome/WelcomeGiftWrap.kt | 4 +- .../quartz/nip01Core/signers/NostrSigner.kt | 4 +- .../nip01Core/signers/NostrSignerInternal.kt | 4 +- .../nip01Core/signers/NostrSignerSync.kt | 4 +- .../quartz/nip13Pow/signer/PoWNostrSigner.kt | 4 +- ...annelListDiff.kt => PublicChatListDiff.kt} | 8 +- .../list/PublicChatListEvent.kt | 6 +- .../signer/NostrSignerRemote.kt | 4 +- .../nip50Search/SearchFieldExtractor.kt | 8 +- .../BookmarkSetEvent.kt | 8 +- .../TagArrayBuilderExt.kt | 2 +- .../nip51Lists/followList/Deprecated.kt | 90 +++++++++++++++++++ .../FollowSetEvent.kt | 8 +- .../TagArrayBuilderExt.kt | 2 +- .../{peopleList => followSet}/TagArrayExt.kt | 2 +- .../nip51Lists/hashtagList/Deprecated.kt | 61 +++++++++++++ .../InterestListDiff.kt} | 4 +- .../InterestListEvent.kt | 14 +-- .../TagArrayBuilderExt.kt | 2 +- .../TagArrayExt.kt | 2 +- .../labeledBookmarkList/Deprecated.kt | 58 ++++++++++++ .../mediaStarterPack/MediaStarterPackEvent.kt | 6 +- .../nip51Lists/peopleList/Deprecated.kt | 83 +++++++++++++++++ .../ReleaseArtifactSetEvent.kt | 10 ++- .../StarterPackEvent.kt | 8 +- .../TagArrayBuilderExt.kt | 2 +- .../TagArrayExt.kt | 2 +- .../nip57Zaps/IPrivateZapsDecryptionCache.kt | 4 +- .../quartz/nip57Zaps/PrivateZapCache.kt | 6 +- ...nZapPrivateEvent.kt => PrivateZapEvent.kt} | 12 ++- .../nip57Zaps/PrivateZapRequestBuilder.kt | 8 +- .../validate/LnurlEndpointResolver.kt | 2 +- ...iptValidator.kt => ZapReceiptValidator.kt} | 8 +- .../clientTag/NostrSignerWithClientTag.kt | 4 +- .../quartz/utils/EventFactory.kt | 12 +-- .../SoftwareApplicationEventTest.kt | 26 ++++++ ...ameTest.kt => UserAssertionPetNameTest.kt} | 2 +- .../store/sqlite/QueryAssemblerTest.kt | 2 +- .../BunkerRequestProcessorConcurrencyTest.kt | 4 +- .../server/BunkerRequestProcessorTest.kt | 6 +- .../server/NostrConnectSignerServiceTest.kt | 4 +- ...entTest.kt => NwcRequestNip44EventTest.kt} | 2 +- .../nip50Search/SearchFieldExtractorTest.kt | 6 +- .../relayLists/RelayListPublicEntriesTest.kt | 2 +- ...nonTagTest.kt => ZapRequestAnonTagTest.kt} | 2 +- ...upTagTest.kt => ZapRequestGroupTagTest.kt} | 2 +- ...indTagTest.kt => ZapRequestKindTagTest.kt} | 2 +- ...atorTest.kt => ZapReceiptValidatorTest.kt} | 66 +++++++------- .../nip01Core/jackson/JacksonMapperTest.kt | 2 +- .../KotlinSerializationMapperTest.kt | 2 +- 252 files changed, 1262 insertions(+), 945 deletions(-) rename amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/{labeledBookmarkLists/LabeledBookmarkListsState.kt => bookmarkSets/BookmarkSetsState.kt} (80%) rename amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/{relayFeeds/RelayFeedListState.kt => favoriteRelays/FavoriteRelayListState.kt} (65%) rename amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/{peopleList/PeopleListsState.kt => followSets/FollowSetsState.kt} (95%) rename amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/{peopleList/FollowListsState.kt => followSets/StarterPacksState.kt} (91%) rename amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/{hashtagLists/HashtagListState.kt => interestLists/InterestListState.kt} (80%) rename amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/{FollowList.kt => StarterPack.kt} (99%) rename amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/dvms/dal/{NIP90ContentDiscoveryFeedViewModel.kt => DvmContentDiscoveryFeedViewModel.kt} (89%) rename amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/dvms/dal/{NIP90ContentDiscoveryResponseFilter.kt => DvmContentDiscoveryResponseFilter.kt} (98%) rename amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/relays/feeds/{RelayFeedsListViewModel.kt => FavoriteRelayListViewModel.kt} (90%) rename amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/video/{FileHeaderCardCompose.kt => FileMetadataCardCompose.kt} (93%) rename commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/{labeledBookmarkLists/LabeledBookmarkList.kt => bookmarkSets/BookmarkSet.kt} (94%) rename commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/{relayFeeds/RelayFeedsListDecryptionCache.kt => favoriteRelays/FavoriteRelayListDecryptionCache.kt} (92%) rename commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/{peopleList/PeopleListDecryptionCache.kt => followSets/FollowSetDecryptionCache.kt} (94%) rename commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/{peopleList => followSets}/PeopleList.kt (96%) rename commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/{hashtagLists/HashtagListDecryptionCache.kt => interestLists/InterestListDecryptionCache.kt} (86%) rename commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip85TrustedAssertions/{ContactCardDecryptionCache.kt => UserAssertionDecryptionCache.kt} (98%) rename commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip85TrustedAssertions/{ContactCardsState.kt => UserAssertionsState.kt} (98%) rename quartz/src/androidDeviceTest/kotlin/com/vitorpamplona/quartz/nip47WalletConnect/{LnZapPaymentRequestNip44EventTest.kt => NwcRequestNip44EventTest.kt} (98%) rename quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip28PublicChat/list/{ChannelListDiff.kt => PublicChatListDiff.kt} (84%) rename quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/{labeledBookmarkList => bookmarkSet}/BookmarkSetEvent.kt (97%) rename quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/{labeledBookmarkList => bookmarkSet}/TagArrayBuilderExt.kt (97%) create mode 100644 quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/followList/Deprecated.kt rename quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/{peopleList => followSet}/FollowSetEvent.kt (98%) rename quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/{peopleList => followSet}/TagArrayBuilderExt.kt (97%) rename quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/{peopleList => followSet}/TagArrayExt.kt (96%) create mode 100644 quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/hashtagList/Deprecated.kt rename quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/{hashtagList/HashtagListDiff.kt => interestList/InterestListDiff.kt} (95%) rename quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/{hashtagList => interestList}/InterestListEvent.kt (95%) rename quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/{hashtagList => interestList}/TagArrayBuilderExt.kt (96%) rename quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/{hashtagList => interestList}/TagArrayExt.kt (96%) create mode 100644 quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/labeledBookmarkList/Deprecated.kt create mode 100644 quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/peopleList/Deprecated.kt rename quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/{followList => starterPack}/StarterPackEvent.kt (95%) rename quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/{followList => starterPack}/TagArrayBuilderExt.kt (97%) rename quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/{followList => starterPack}/TagArrayExt.kt (96%) rename quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/{LnZapPrivateEvent.kt => PrivateZapEvent.kt} (87%) rename quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/validate/{LnZapReceiptValidator.kt => ZapReceiptValidator.kt} (95%) rename quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/experimental/nip85TrustedAssertions/{ContactCardPetNameTest.kt => UserAssertionPetNameTest.kt} (99%) rename quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip47WalletConnect/{LnZapPaymentRequestNip44EventTest.kt => NwcRequestNip44EventTest.kt} (98%) rename quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip57Zaps/{LnZapRequestAnonTagTest.kt => ZapRequestAnonTagTest.kt} (99%) rename quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip57Zaps/{LnZapRequestGroupTagTest.kt => ZapRequestGroupTagTest.kt} (99%) rename quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip57Zaps/{LnZapRequestKindTagTest.kt => ZapRequestKindTagTest.kt} (99%) rename quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip57Zaps/validate/{LnZapReceiptValidatorTest.kt => ZapReceiptValidatorTest.kt} (70%) diff --git a/.claude/skills/account-state/SKILL.md b/.claude/skills/account-state/SKILL.md index 528a2dd273..6abc975cb4 100644 --- a/.claude/skills/account-state/SKILL.md +++ b/.claude/skills/account-state/SKILL.md @@ -43,10 +43,10 @@ Relay frame ──► LocalCache.insertOrUpdateNote() ──► LocalCacheFlow e - `kind3FollowList = Kind3FollowListState(...)` ← NIP-02 ContactList (kind 3) - `nip65RelayList = Nip65RelayListState(...)` ← NIP-65 RelayList (kind 10002), plus siblings `dmRelayList`, `searchRelayList`, `blockedRelayList`, `trustedRelayList`, `proxyRelayList`, `broadcastRelayList`, `indexerRelayList`, … - `muteList = MuteListState(...)` ← NIP-51 MuteList (kind 10000) - - `bookmarkState = BookmarkListState(...)` ← NIP-51 Bookmarks (kind 10003), plus `labeledBookmarkLists`, `pinState`, `interestSets`, `peopleLists`, `followLists`, `hashtagList`, `geohashList`, `communityList`, `emoji`, `blossomServers`, … + - `bookmarkState = BookmarkListState(...)` ← NIP-51 Bookmarks (kind 10003), plus `bookmarkSets`, `pinState`, `interestSets`, `peopleLists`, `followLists`, `hashtagList`, `geohashList`, `communityList`, `emoji`, `blossomServers`, … - Derived/merged views: `hiddenUsers`, `allFollows`, `homeRelays`, `outboxRelays`, `dmRelays`, `notificationRelays`, `trustedRelays`, and the `live*FollowListsPerRelay` outbox loaders. - **The pattern:** each `XState` class pins its addressable note via `cache.getOrCreateAddressableNote(address)` (a long-term reference so GC/eviction can't drop it), exposes `val flow: StateFlow<…>` derived from the note's metadata flow (decrypted through a per-feature `DecryptionCache`, with backup fallback from `AccountSettings`, `stateIn(scope, Eagerly, …)`), and offers suspend mutation helpers (e.g. `MuteListState.hideUser(pubkey)`) that build the updated signed event. Consumers read `account.muteList.flow`, never a raw `MutableStateFlow` on `Account`. -- Encrypted lists pair the state object with a `DecryptionCache` sibling (`muteListDecryptionCache`, `peopleListDecryptionCache`, …) so NIP-44 decryption results are cached per event. +- Encrypted lists pair the state object with a `DecryptionCache` sibling (`muteListDecryptionCache`, `followSetDecryptionCache`, …) so NIP-44 decryption results are cached per event. - UI reads via `collectAsStateWithLifecycle` on Android and `collectAsState` on Desktop. - Sibling files per feature live alongside: `AccountSettings.kt`, `AccountSyncedSettings.kt`, plus per-NIP state classes under `model/nip02FollowLists/`, `model/nip51Lists/`, `model/nip65RelayList/`, etc. diff --git a/.claude/skills/account-state/references/account-state-flow.md b/.claude/skills/account-state/references/account-state-flow.md index d7e37c5524..73a56cca1b 100644 --- a/.claude/skills/account-state/references/account-state-flow.md +++ b/.claude/skills/account-state/references/account-state-flow.md @@ -16,8 +16,8 @@ been renamed, grep `Account.kt` for the class name.) | `userMetadata` | `UserMetadataState` | 0 | `amethyst/.../model/nip01UserMetadata/` | | `kind3FollowList` | `Kind3FollowListState` | 3 | `model/nip02FollowLists/` | | `muteList` (+ `muteListDecryptionCache`) | `MuteListState` | 10000 | `model/nip51Lists/muteList/` | -| `blockPeopleList`, `peopleLists` | `BlockPeopleListState`, `PeopleListsState` | NIP-51 people sets | `model/nip51Lists/peopleList/` | -| `followLists` | `FollowListsState` | NIP-51 follow sets | `model/nip51Lists/peopleList/` | +| `blockPeopleList`, `peopleLists` | `BlockPeopleListState`, `FollowSetsState` | NIP-51 people sets | `model/nip51Lists/followSets/` | +| `followLists` | `StarterPacksState` | NIP-51 follow sets | `model/nip51Lists/followSets/` | | `hiddenUsers` | `HiddenUsersState` — derived from `muteList.flow` + `blockPeopleList.flow` | — | `model/nip51Lists/` | | `allFollows` | `MergedFollowListsState` — merges kind3 + people/follow/hashtag/geohash/community lists | — | `model/serverList/` | @@ -31,7 +31,7 @@ been renamed, grep `Account.kt` for the class name.) | `blockedRelayList` | `BlockedRelayListState` | 10006 | `model/nip51Lists/blockedRelays/` | | `localRelayList` | `LocalRelayListState` | local | `model/localRelays/` | | `privateStorageRelayList` | `PrivateStorageRelayListState` | private storage | `model/edits/` | -| `keyPackageRelayList`, `trustedRelayList`, `proxyRelayList`, `broadcastRelayList`, `indexerRelayList`, `relayFeedsList` | per-feature `…RelayListState` classes, each with a `DecryptionCache` sibling | custom relay sets | `model/nip51Lists/…` | +| `keyPackageRelayList`, `trustedRelayList`, `proxyRelayList`, `broadcastRelayList`, `indexerRelayList`, `favoriteRelayList` | per-feature `…RelayListState` classes, each with a `DecryptionCache` sibling | custom relay sets | `model/nip51Lists/…` | Derived relay views (merge several of the above): `homeRelays` (`AccountHomeRelayState`), `outboxRelays`, `dmRelays`, `notificationRelays`, @@ -43,10 +43,10 @@ Derived relay views (merge several of the above): `homeRelays` | Account property | State class | Kind | Package | |------------------|-------------|------|---------| | `bookmarkState` (and legacy `oldBookmarkState`) | `BookmarkListState` | 10003 | `model/nip51Lists/` | -| `labeledBookmarkLists` | `LabeledBookmarkListsState` | NIP-51 bookmark sets | `model/nip51Lists/labeledBookmarkLists/` | +| `bookmarkSets` | `BookmarkSetsState` | NIP-51 bookmark sets | `model/nip51Lists/bookmarkSets/` | | `pinState` | `PinListState` | NIP-51 | `model/nip51Lists/` | | `interestSets` | `InterestSetsState` | NIP-51 interest sets | `model/nip51Lists/interestSets/` | -| `hashtagList` / `geohashList` | `HashtagListState` / `GeohashListState` | NIP-51 | `model/nip51Lists/hashtagLists/`, `…/geohashLists/` | +| `hashtagList` / `geohashList` | `InterestListState` / `GeohashListState` | NIP-51 | `model/nip51Lists/interestLists/`, `…/geohashLists/` | | `communityList` | `CommunityListState` | NIP-72 communities | `model/nip72Communities/` | | `favoriteAlgoFeedsList` | `FavoriteAlgoFeedsListState` | NIP-51 | `model/nip51Lists/` | | `emoji`, `ownedEmojiPacks` | `EmojiPackState`, `OwnedEmojiPacksState` | 10030 | `commons/.../commons/model/nip30CustomEmojis/` | diff --git a/.claude/skills/nip85-trusted-assertions/SKILL.md b/.claude/skills/nip85-trusted-assertions/SKILL.md index d75415e4df..935ea8e3d4 100644 --- a/.claude/skills/nip85-trusted-assertions/SKILL.md +++ b/.claude/skills/nip85-trusted-assertions/SKILL.md @@ -92,8 +92,8 @@ The same kind serves two roles, distinguished **by author**: 2. **The account's own contact cards (nicknames, NIP-81-style)** — signed by the account, one per target user. The petname, summary, and their NIP-30 emoji mappings **always live in the NIP-44 encrypted content, never in public tags** (`UserAssertionEvent.build`/ - `updatePetNameAndSummary` strip stray public copies; asserted by `ContactCardPetNameTest`). - `commons/.../ContactCardsState.kt` keys everything on `author == account` and ignores + `updatePetNameAndSummary` strip stray public copies; asserted by `UserAssertionPetNameTest`). + `commons/.../UserAssertionsState.kt` keys everything on `author == account` and ignores provider cards. ## Tag vocabulary and value semantics @@ -225,8 +225,8 @@ card's `a`-tag (`30382::`). - **Publisher**: `quartz/.../experimental/graperank/GrapeRankPublisher.kt` (canonical 30382 writer), `cli/.../graperank/` (`amy graperank register|unregister|providers|publish`). -- **Client model**: `commons/.../model/nip85TrustedAssertions/` (`ContactCardsState`, - `UserCardsCache`, `ContactCardDecryptionCache`, `TrustProviderListDecryptionCache`), +- **Client model**: `commons/.../model/nip85TrustedAssertions/` (`UserAssertionsState`, + `UserCardsCache`, `UserAssertionDecryptionCache`, `TrustProviderListDecryptionCache`), `amethyst/.../model/trustedAssertions/TrustProviderListState.kt`. - **Relay plumbing**: `commons/.../relayClient/assemblers/ContactCardFilters.kt`, `amethyst/.../reqCommand/user/watchers/UserCardsSubAssembler.kt`. diff --git a/.claude/skills/searchable-events/SKILL.md b/.claude/skills/searchable-events/SKILL.md index aad4744f68..f27492bf5f 100644 --- a/.claude/skills/searchable-events/SKILL.md +++ b/.claude/skills/searchable-events/SKILL.md @@ -45,10 +45,9 @@ Notables that surprise people: (`zapRequest?.content.orEmpty()`) — receipts are searchable by the zapper's comment. - **Kind 0 / 31990** index many profile fields space-joined (name, about, nip05, lud16, website, picture URL, …). -- **Kind 30063 is claimed twice** (`ReleaseArtifactSetEvent` in nip51Lists and the experimental - `SoftwareReleaseEvent`); `EventFactory` resolves 30063 to `ReleaseArtifactSetEvent`, so - `title()\ndescription()` is what actually gets indexed — `SoftwareReleaseEvent.indexableContent()` - is dead on the store path. +- **Kind 30063** (`ReleaseArtifactSetEvent`) serves both NIP-51 release artifact sets and NIP-82 + software releases: it indexes `title()\ndescription()`, plus the release notes in `content` only + for NIP-82 releases (NIP-51 `content` can be encrypted private items). - Poll kinds (1068, 6969) append each option label on its own line. ## MANDATORY maintenance when you touch this surface diff --git a/.claude/skills/searchable-events/references/searchable-kinds.md b/.claude/skills/searchable-events/references/searchable-kinds.md index 92688128ec..d9942a6530 100644 --- a/.claude/skills/searchable-events/references/searchable-kinds.md +++ b/.claude/skills/searchable-events/references/searchable-kinds.md @@ -5,7 +5,7 @@ expression. **Update this file in the same PR as any change to the searchable se `indexableContent()` body** (see SKILL.md). Verified against the code 2026-09-17. Counts: 137 concrete classes covering 140 kind values (`GitStatusEvent` spans 4 kinds; -kind 30063 has a collision — see the footnote). File paths are under +kind 30063 is shared by two NIPs — see the footnote). File paths are under `quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/`. Separator legend: **NL** = `joinToString("\n")`, **SP** = `joinToString(" ")`. @@ -74,10 +74,10 @@ Separator legend: **NL** = `joinToString("\n")`, **SP** = `joinToString(" ")`. | 12473 | BirdexEvent | experimental/birdstar | `(listOfNotNull(summary()) + speciesNames())` NL | | 15128 | RootSiteEvent | nip5aStaticWebsites | `listOfNotNull(title(), description())` NL | | 15129 | RootNappletEvent | nip5dNapplets | `listOfNotNull(title(), description())` NL | -| 30000 | FollowSetEvent | nip51Lists/peopleList | `listOfNotNull(titleOrName(), description())` NL | +| 30000 | FollowSetEvent | nip51Lists/followSet | `listOfNotNull(titleOrName(), description())` NL | | 30001 | OldBookmarkListEvent | nip51Lists/bookmarkList | `listOfNotNull(title())` NL | | 30002 | RelaySetEvent | nip51Lists/relaySets | `listOfNotNull(title(), description())` NL | -| 30003 | BookmarkSetEvent | nip51Lists/labeledBookmarkList | `listOfNotNull(titleOrName(), description())` NL | +| 30003 | BookmarkSetEvent | nip51Lists/bookmarkSet | `listOfNotNull(titleOrName(), description())` NL | | 30004 | ArticleCurationSetEvent | nip51Lists/articleCurationSet | `listOfNotNull(title(), description())` NL | | 30005 | VideoCurationSetEvent | nip51Lists/videoCurationSet | `listOfNotNull(title(), description())` NL | | 30006 | PictureCurationSetEvent | nip51Lists/pictureCurationSet | `listOfNotNull(title(), description())` NL | @@ -91,7 +91,7 @@ Separator legend: **NL** = `joinToString("\n")`, **SP** = `joinToString(" ")`. | 30030 | EmojiPackEvent | nip30CustomEmoji/pack | `listOfNotNull(titleOrName(), description(), content)` NL | | 30054 | Podcasting20EpisodeEvent | nipXXPodcasting20/episode | `(listOfNotNull(title(), description(), content) + topics())` NL | | 30055 | Podcasting20TrailerEvent | nipXXPodcasting20/trailer | `listOfNotNull(title(), content)` NL | -| 30063 | ReleaseArtifactSetEvent † | nip51Lists/releaseArtifactSet | `listOfNotNull(title(), description())` NL | +| 30063 | ReleaseArtifactSetEvent † | nip51Lists/releaseArtifactSet | `listOfNotNull(title(), description(), content if NIP-82)` NL | | 30175 | PersonaEvent | buzz/apPersonas | `personaOrNull()?.let { listOfNotNull(it.displayName, it.systemPrompt).joinToString("\n") } ?: ""` | | 30176 | TeamEvent | buzz/teams | `teamOrNull()?.let { listOfNotNull(it.name, it.description, it.instructions).joinToString("\n") } ?: ""` | | 30177 | ManagedAgentEvent | buzz/managedAgents | `agentOrNull()?.let { listOfNotNull(it.name, it.systemPrompt).joinToString("\n") } ?: ""` | @@ -138,7 +138,7 @@ Separator legend: **NL** = `joinToString("\n")`, **SP** = `joinToString(" ")`. | 38192 | Ps1SaveEvent | experimental/ps1saves | `listOfNotNull(summary(), saveTitle(), region(), filename())` NL | | 38383 | P2POrderEvent | nip69P2pOrderEvents | `(listOfNotNull(makerName(), currency()) + paymentMethods().orEmpty()).joinToString(" ")` (SP) | | 39000 | GroupMetadataEvent | nip29RelayGroups/metadata | `listOfNotNull(name(), about())` NL | -| 39089 | StarterPackEvent | nip51Lists/followList | `listOfNotNull(title(), description())` NL | +| 39089 | StarterPackEvent | nip51Lists/starterPack | `listOfNotNull(title(), description())` NL | | 39092 | MediaStarterPackEvent | nip51Lists/mediaStarterPack | `listOfNotNull(title(), description())` NL | | 39307 | TextTrackEvent | nip71Video/textTrack | `content` (the WebVTT cue text) | | 39701 | WebBookmarkEvent | nipB0WebBookmarks | `listOfNotNull(title(), description())` NL | @@ -150,10 +150,10 @@ Separator legend: **NL** = `joinToString("\n")`, **SP** = `joinToString(" ")`. | 45003 | ForumCommentEvent | buzz/forum | `content` | | 48106 | HuddleGuidelinesEvent | buzz/huddles | `content` | -† **Kind 30063 collision:** `experimental/nip82SoftwareApps/release/SoftwareReleaseEvent` also -declares `KIND = 30063` and implements `SearchableEvent` (`content`), but `EventFactory` maps -30063 to `ReleaseArtifactSetEvent`, so on every store path kind 30063 indexes -`title()\ndescription()`. If the factory mapping ever changes, this table changes with it. +† **Kind 30063 is shared** by NIP-51 release artifact sets and NIP-82 software releases, and +`ReleaseArtifactSetEvent` parses both. It indexes `title()` and `description()`, plus `content` +(the release notes) only when the event carries the NIP-82 `i` + `version` tags — a NIP-51 set +may hold encrypted private items in `content`, which must never be indexed. ## Abstract bases (no kind of their own) diff --git a/amethyst/plans/2026-07-01-auth-permission-architecture.md b/amethyst/plans/2026-07-01-auth-permission-architecture.md index f3d431047a..17dce367c7 100644 --- a/amethyst/plans/2026-07-01-auth-permission-architecture.md +++ b/amethyst/plans/2026-07-01-auth-permission-architecture.md @@ -68,7 +68,7 @@ The NIP-42 plumbing and a first-cut permission gate are already in place: | Settings screen (global policy + per-relay list) | `amethyst/.../ui/screen/loggedIn/relayauth/RelayAuthSettingsScreen.kt` | | Global policy setting, persisted local-only | `AccountSettings.defaultRelayAuthPolicy`, `LocalPreferences` key `DEFAULT_RELAY_AUTH_POLICY` | | Blocked-relay list (kind 10006) | `amethyst/.../model/nip51Lists/blockedRelays/BlockedRelayListState.kt` (`.flow`) | -| Follow checks | `Account.isFollowing(...)`, `Account.allFollows.flow.value.authors`, `FollowListsState.isUserInFollowSets(...)` | +| Follow checks | `Account.isFollowing(...)`, `Account.allFollows.flow.value.authors`, `StarterPacksState.isUserInFollowSets(...)` | | DM / NIP-65 relay lookups | `DmRelayListState`, `Nip65RelayListState` (+ per-user via `LocalCache`) | ## The gap @@ -180,7 +180,7 @@ class RelayAuthContext(val relayUrl: String, val purposes: List) - `IF_IN_MY_LIST` → `ALLOW` if relay ∈ my relay lists, else fall through - `TRUSTED_FOLLOWS` *(new — see idea A below)* → `ALLOW` if relay ∈ my lists **or** any counterparty in `ctx.purposes` is followed (`Account.allFollows` - / `FollowListsState.isUserInFollowSets`) and the purpose permits it; else + / `StarterPacksState.isUserInFollowSets`) and the purpose permits it; else fall through. 4. **Fall-through**: `ASK` if the purpose is attributable (we can show a reason); otherwise `DENY` silently (don't prompt for anonymous stranger challenges). diff --git a/amethyst/plans/2026-07-07-nip29-armada-study.md b/amethyst/plans/2026-07-07-nip29-armada-study.md index 4d8e0aa3cf..7c430631de 100644 --- a/amethyst/plans/2026-07-07-nip29-armada-study.md +++ b/amethyst/plans/2026-07-07-nip29-armada-study.md @@ -392,11 +392,11 @@ can be a group event if it carries `h` and the relay accepts the kind." has: - `metadata/` — `GroupMetadataEvent` (kind **39000**), `GroupAdminsEvent` - (39001), `GroupMembersEvent` (39002), `SupportedRolesEvent` (39003). -- `moderation/` — `CreateGroupEvent` (9007), `EditMetadataEvent` (9002), - `PutUserEvent` (9000), `RemoveUserEvent` (9001), `DeleteEventEvent` (9005), - `DeleteGroupEvent` (9008), `CreateInviteEvent` (9009), plus tag helpers. -- `request/` — `JoinRequestEvent` (9021), `LeaveRequestEvent` (9022). + (39001), `GroupMembersEvent` (39002), `GroupRolesEvent` (39003). +- `moderation/` — `CreateGroupEvent` (9007), `GroupEditMetadataEvent` (9002), + `GroupPutUserEvent` (9000), `GroupRemoveUserEvent` (9001), `GroupDeleteEventEvent` (9005), + `DeleteGroupEvent` (9008), `GroupCreateInviteEvent` (9009), plus tag helpers. +- `request/` — `GroupJoinRequestEvent` (9021), `GroupLeaveRequestEvent` (9022). - `tags/` — `GroupIdTag` (the `h` tag), `CodeTag`, `GroupAdminTag`, `RoleTag`, and even a `PreviousTag`. @@ -427,7 +427,7 @@ NIP-04/17 DMs, NIP-28 public channels, and NIP-C7 ephemeral chats — all under ### 5.2 The main protocol gap There is **no kind-9 group chat message event** in `nip29RelayGroups/` -(`CreateInviteEvent` at 9009 is the highest kind present; nothing for kind 9). +(`GroupCreateInviteEvent` at 9009 is the highest kind present; nothing for kind 9). The 9xxx moderation, 39xxx metadata, and 9021/9022 request events exist, but the actual message carrier does not. This is the first thing to build: diff --git a/amethyst/plans/2026-07-13-chat-scroll-performance.md b/amethyst/plans/2026-07-13-chat-scroll-performance.md index 4b066c6858..dd7de42179 100644 --- a/amethyst/plans/2026-07-13-chat-scroll-performance.md +++ b/amethyst/plans/2026-07-13-chat-scroll-performance.md @@ -71,7 +71,7 @@ Feed-level: marker update (only the newest visible timestamp matters; the marker is monotonic). One coroutine per scroll session instead of one per row. 6. **Jumbo without a coroutine (#4)**: only launch the decrypt effect for - encrypted kinds (`PrivateDmEvent`, sealed rumors not yet in the decrypt + encrypted kinds (`EncryptedDmEvent`, sealed rumors not yet in the decrypt cache). Plaintext kinds (public chats, NIP-17 rumors already unwrapped — the vast majority) take the synchronous path only. 7. **Retire settled delivery ticks (#6)**: once a message is fully accepted (or diff --git a/amethyst/plans/2026-07-15-bitchat-geohash-interop.md b/amethyst/plans/2026-07-15-bitchat-geohash-interop.md index 2722de432e..09af8f3a48 100644 --- a/amethyst/plans/2026-07-15-bitchat-geohash-interop.md +++ b/amethyst/plans/2026-07-15-bitchat-geohash-interop.md @@ -55,7 +55,7 @@ Bitchat's Nostr side has two chat features. Amethyst is a pure-Nostr client 1. **Encrypted DMs (Phase 2).** Port the `bitchat1:` binary packet (`BitchatPacket` TLV + `NoisePayloadType`) into quartz, wrap/unwrap it in the - existing NIP-17 stack (`GiftWrapEvent`/`SealedRumorEvent`/`ChatMessageEvent`), + existing NIP-17 stack (`GiftWrapEvent`/`SealEvent`/`ChatMessageEvent`), handle geohash DMs (to a per-geohash pubkey) and delivery/read receipts. Add `amy geochat dm` for interop testing. 2. **Desktop UI.** The shared pieces (quartz events, `GeoRelayDirectory`) are diff --git a/amethyst/plans/2026-07-23-push-notification-redesign.md b/amethyst/plans/2026-07-23-push-notification-redesign.md index 2e0acac758..a2f8d535ee 100644 --- a/amethyst/plans/2026-07-23-push-notification-redesign.md +++ b/amethyst/plans/2026-07-23-push-notification-redesign.md @@ -178,10 +178,10 @@ This keeps the *policy* (who gets notified) exactly where it is and isolates the | Kind(s) | Category | Style | Accent / icon | Title → Body | Actions | | --- | --- | --- | --- | --- | --- | -| NIP-17 `ChatMessageEvent` (14), file (15), NIP-04 `PrivateDmEvent` (4), Marmot group | DIRECT_MESSAGE | `MessagingStyle` + Conversation shortcut + Bubble | blue-green / `chat` | sender → message | Reply, Mark-read | +| NIP-17 `ChatMessageEvent` (14), file (15), NIP-04 `EncryptedDmEvent` (4), Marmot group | DIRECT_MESSAGE | `MessagingStyle` + Conversation shortcut + Bubble | blue-green / `chat` | sender → message | Reply, Mark-read | | `TextNoteEvent`(1)/`CommentEvent`(1111)/`ChannelMessageEvent`(42) **reply to me** | REPLY | `MessagingStyle` (parent as prior message) | purple / `reply` | "X replied" → excerpt (+ quoted parent) | Reply, View thread, Mute thread | | Same kinds, **mention/quote only** | MENTION | plain (BigText) | purple / `alternate_email` | "X mentioned you" → excerpt | View, Mute thread | -| `LnZapEvent`(9735) | ZAP | **colorized** amount card (BigText) | gold / `bolt` | "⚡ 2,100 sats from X" → zap comment + zapped-note excerpt | Zap back, View | +| `ZapReceiptEvent`(9735) | ZAP | **colorized** amount card (BigText) | gold / `bolt` | "⚡ 2,100 sats from X" → zap comment + zapped-note excerpt | Zap back, View | | `NutzapEvent`(9321) *(new)* | ZAP | colorized amount card | gold / `bolt` (cashu tint) | "🥜 X nutzapped you 2,100 sats" → … | Zap back, View | | `OnchainZapEvent`(8333) *(new)* | ZAP | colorized amount card | gold / `bolt` | "⛓ X sent an onchain zap" → … | View | | `ReactionEvent`(7) | REACTION | aggregated `InboxStyle` | heart-red / `favorite` | "🤙 X & N others liked your post" → note excerpt | Like back, View | @@ -189,7 +189,7 @@ This keeps the *policy* (who gets notified) exactly where it is and isolates the | `PictureEvent`(20)/`VideoNormal`/`Short`/`Vertical`/`Horizontal` | MEDIA | `BigPictureStyle` | purple / `image` | "X shared a photo/video" → caption, image inline | View | | `PollEvent`/`ZapPollEvent` | MENTION | plain | purple / `ballot` | "X asked a question" → poll title | Vote, View | | `HighlightEvent`(9802) | ARTICLE | plain | purple / `format_quote` | "X highlighted your article" → highlighted text | View | -| `LongTextNoteEvent`(30023)/`WikiNoteEvent`(30818) | ARTICLE | plain | purple / `article` | "X mentioned you in an article" → title | View | +| `LongFormContentEvent`(30023)/`WikiArticleEvent`(30818) | ARTICLE | plain | purple / `article` | "X mentioned you in an article" → title | View | | `GitIssueEvent`/`GitPatchEvent`/`GitPullRequestEvent`/`…Update` | CODE | plain | slate / `merge` | "X opened an issue/PR" → subject | View | | `BadgeAwardEvent`(8) *(new)* | BADGE | `BigPictureStyle` (badge art) | gold / `award_star` | "You earned a badge" → badge name, image | View | | `LiveChessGameAcceptEvent`/`LiveChessMoveEvent` | CHESS | plain | brown / `chess` | "X accepted your challenge" / "your turn" | Open board | diff --git a/amethyst/plans/2026-07-24-nwc-bolt12-pay.md b/amethyst/plans/2026-07-24-nwc-bolt12-pay.md index e42b00a729..4f4e0ba89a 100644 --- a/amethyst/plans/2026-07-24-nwc-bolt12-pay.md +++ b/amethyst/plans/2026-07-24-nwc-bolt12-pay.md @@ -59,7 +59,7 @@ and dispatches the decrypted `Response`, so a new method needs no changes there: decrypt-on-arrival. - `NwcPaymentTracker` (`commons/…/service/nwc/`) — request↔response match with the author-spoof gate. -- `LocalCache.consume(LnZapPaymentResponseEvent)` — routes 23195 back to the callback. +- `LocalCache.consume(NwcResponseEvent)` — routes 23195 back to the callback. - Wallet storage: `AccountSettings.nwcWallets` + `defaultPaymentSourceId`; `PaymentSourceResolver`. - Pay rail entry: `ZapPaymentHandler.zap()` → `payViaNWC()` (the `PaymentSource.Nwc` diff --git a/amethyst/plans/2026-07-31-shortpost-notify-list-picker.md b/amethyst/plans/2026-07-31-shortpost-notify-list-picker.md index e7a382b5d3..0e8cfe0552 100644 --- a/amethyst/plans/2026-07-31-shortpost-notify-list-picker.md +++ b/amethyst/plans/2026-07-31-shortpost-notify-list-picker.md @@ -41,9 +41,9 @@ storm. |---|---| | The chip row + "Add" chip | `ui/note/creators/notify/Notifying.kt` (`Notifying`, `NotifyUserChip`, `AddUserChip`) | | Audience state | `ShortNotePostViewModel.pTags: List?`, `mutedNotifies: Set`, `activeNotifies()`, `addToReplyList(user)` | -| My NIP-51 people lists (kind 30000, public **and** decrypted private members) | `account.peopleLists.uiListFlow: StateFlow>` (`model/nip51Lists/peopleList/PeopleListsState.kt`) | -| My follow packs (kind 39089, public members) | `account.followLists.uiListFlow` (`model/nip51Lists/peopleList/FollowListsState.kt`) | -| `PeopleList` UI model (`title`, `image`, `publicMembers`, `privateMembers` as `Set`) | `model/nip51Lists/peopleList/PeopleList.kt` | +| My NIP-51 people lists (kind 30000, public **and** decrypted private members) | `account.peopleLists.uiListFlow: StateFlow>` (`model/nip51Lists/followSets/FollowSetsState.kt`) | +| My follow packs (kind 39089, public members) | `account.followLists.uiListFlow` (`model/nip51Lists/followSets/StarterPacksState.kt`) | +| `PeopleList` UI model (`title`, `image`, `publicMembers`, `privateMembers` as `Set`) | `model/nip51Lists/followSets/PeopleList.kt` | | Two-column list catalog rendering | `ui/screen/loggedIn/lists/memberEdit/FollowListAndPackAndUserView.kt` — same "Follow sets" + "Discover follows" sectioning | | Multi-select member review (count header, select-all checkbox, per-user row, confirm button) | `ui/screen/loggedIn/newUser/ImportFollowListPickFollowsScreen.kt` (`PreviewList` / `FollowEntryRow`) | | Bottom-sheet picker shell w/ search field | `ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupParentPicker.kt` | diff --git a/amethyst/plans/2026-09-10-dvm-heartbeat-liveness-plan.md b/amethyst/plans/2026-09-10-dvm-heartbeat-liveness-plan.md index dfe5996c2d..d56b7fd2e5 100644 --- a/amethyst/plans/2026-09-10-dvm-heartbeat-liveness-plan.md +++ b/amethyst/plans/2026-09-10-dvm-heartbeat-liveness-plan.md @@ -281,7 +281,7 @@ In `quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/utils/EventFactory.kt` ```kotlin import com.vitorpamplona.quartz.nip90Dvms.dvmHeartbeat.DvmHeartbeatEvent ``` -2. Add a dispatch branch inside the `when (kind)` near the other NIP-90 kinds (next to line 736 `NIP90StatusEvent.KIND -> ...`): +2. Add a dispatch branch inside the `when (kind)` near the other NIP-90 kinds (next to line 736 `DvmStatusEvent.KIND -> ...`): ```kotlin DvmHeartbeatEvent.KIND -> DvmHeartbeatEvent(id, pubKey, createdAt, tags, content, sig) ``` @@ -304,7 +304,7 @@ private val knownDTagReaders = - [ ] **Step 6: Update the design doc §2** -In `amethyst/plans/2026-09-10-dvm-heartbeat-liveness.md`, replace the §2 bullet that says the class "extends `BaseReplaceableEvent`" / "Overrides `dTag()`" with the as-built wording: extends `BaseAddressableEvent` (the codebase convention for 10xxx events with real `d` tags, e.g. `FollowListEvent`), so `dTag()`/`address()`/`addressTag()` come from the base; note `MAX_AGE_SECONDS`, `isFreshAt`, and the `knownDTagReaders` entry live in quartz too (commons imports them). +In `amethyst/plans/2026-09-10-dvm-heartbeat-liveness.md`, replace the §2 bullet that says the class "extends `BaseReplaceableEvent`" / "Overrides `dTag()`" with the as-built wording: extends `BaseAddressableEvent` (the codebase convention for 10xxx events with real `d` tags, e.g. `StarterPackEvent`), so `dTag()`/`address()`/`addressTag()` come from the base; note `MAX_AGE_SECONDS`, `isFreshAt`, and the `knownDTagReaders` entry live in quartz too (commons imports them). - [ ] **Step 7: Run the tests to verify they pass** diff --git a/amethyst/plans/2026-09-10-dvm-heartbeat-liveness.md b/amethyst/plans/2026-09-10-dvm-heartbeat-liveness.md index b67a5cd4bc..3e76ed1eb6 100644 --- a/amethyst/plans/2026-09-10-dvm-heartbeat-liveness.md +++ b/amethyst/plans/2026-09-10-dvm-heartbeat-liveness.md @@ -45,7 +45,7 @@ feeds and the detail surface show an offline state instead. New `quartz/.../nip90Dvms/dvmHeartbeat/DvmHeartbeatEvent.kt`: - `class DvmHeartbeatEvent(...) : BaseAddressableEvent(...)`, `KIND = 11998` — the codebase - convention for 10xxx events with real `d` tags (e.g. `FollowListEvent`), so `dTag()` / + convention for 10xxx events with real `d` tags (e.g. `StarterPackEvent`), so `dTag()` / `address()` / `addressTag()` come from the base. The cache address is `Address(11998, dvmPubkey, dTag)`, the exact mirror of the announcement's `Address(31990, dvmPubkey, dTag)`. diff --git a/amethyst/plans/2026-09-17-nip-cc-geocaching.md b/amethyst/plans/2026-09-17-nip-cc-geocaching.md index 837d0de01c..ea2a24df5a 100644 --- a/amethyst/plans/2026-09-17-nip-cc-geocaching.md +++ b/amethyst/plans/2026-09-17-nip-cc-geocaching.md @@ -83,7 +83,7 @@ The listing event is mostly existing tags wearing a new kind number: | `r` | `nip51Lists/tags/RelayTag` (`"r"`) | | `a` | `nip01Core/tags/aTag/ATag` (curation list + found log) | | `title`, `description` (37517) | `nip51Lists/tags/TitleTag`, `.../DescriptionTag` | -| embedded 7517 | `Event.fromJson(...)` (same trick `LnZapEvent.zapRequest()` uses) | +| embedded 7517 | `Event.fromJson(...)` (same trick `ZapReceiptEvent.zapRequest()` uses) | | signature check | `Event.verifySignature()` in `nip01Core/crypto/EventExt.kt` | | kind 1111 logs | `nip22Comments/CommentEvent` **as-is** — it already models `A/K/P` + `a/k/p` addressable root+parent (`rootAddress()`, `replyAddress()`, `hasRootAddress()`). Only the `t` log-type vocabulary is new. | | required-tag gate | `containsAllTagNamesWithValues(REQUIRED_FIELDS)`, as `ClassifiedsEvent.isWellFormed()` does | diff --git a/amethyst/plans/archive/2026-05-14-onchain-zaps.md b/amethyst/plans/archive/2026-05-14-onchain-zaps.md index 4e06e084b3..9a449c7120 100644 --- a/amethyst/plans/archive/2026-05-14-onchain-zaps.md +++ b/amethyst/plans/archive/2026-05-14-onchain-zaps.md @@ -94,7 +94,7 @@ Section labels: "Bitcoin" and "Lightning". ## Subscription edits — extend existing kind lists No new assemblers. Add `OnchainZapEvent.KIND` (8333) to the existing -`LnZapEvent.KIND` (9735) sites: +`ZapReceiptEvent.KIND` (9735) sites: | File | Edit | |---|---| @@ -109,7 +109,7 @@ No new assemblers. Add `OnchainZapEvent.KIND` (8333) to the existing ## Display path — fold into `Note.zapsAmount` -Today: `LocalCache.consume(LnZapEvent)` → `Note.addZap()` → `Note.updateZapTotal()` +Today: `LocalCache.consume(ZapReceiptEvent)` → `Note.addZap()` → `Note.updateZapTotal()` sums lightning amounts into `Note.zapsAmount`, which `ReactionsRow` / `ObserveZapAmountText` / `SlidingAnimationAmount` render. We add onchain zap sats to the same `Note.zapsAmount` — no UI changes required. @@ -118,7 +118,7 @@ sats to the same `Note.zapsAmount` — no UI changes required. - Add `var onchainZaps = mapOf<...>()` (separate map from `zaps`). - Extend `updateZapTotal()` to add **verified** onchain sats. Unverified or pending tx amounts are NOT counted. -- `amethyst/.../model/LocalCache.kt` (after the `consume(LnZapEvent)` block ~line 1667) +- `amethyst/.../model/LocalCache.kt` (after the `consume(ZapReceiptEvent)` block ~line 1667) - New `consume(event: OnchainZapEvent)` handler. - Reject self-zap. - Enqueue verification against the configured `OnchainBackend`. diff --git a/amethyst/plans/archive/2026-06-22-napplet-nsite-security.md b/amethyst/plans/archive/2026-06-22-napplet-nsite-security.md index d9a14ff27d..d6236690cf 100644 --- a/amethyst/plans/archive/2026-06-22-napplet-nsite-security.md +++ b/amethyst/plans/archive/2026-06-22-napplet-nsite-security.md @@ -34,7 +34,7 @@ and what remains as future work. 2. **Private mute/block leak via `identity.getMutes`/`getBlocked`.** These read `muteList.flow` / `blockPeopleList.flow`, which contain **decrypted private** entries. Now they read the events' **public** tags only (`MuteListEvent.publicMutes()`, - `PeopleListEvent.publicUsersIdSet()`). + `FollowSetEvent.publicUsersIdSet()`). 3. **Silent "allow-always" actions + UI-redress.** Added persistent **trusted chrome** (a sandbox bar the applet can't draw over: shield + name + tap-to-see "what it can diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/LocalPreferences.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/LocalPreferences.kt index 7f1b0da472..7a55e9b22c 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/LocalPreferences.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/LocalPreferences.kt @@ -62,7 +62,7 @@ import com.vitorpamplona.quartz.nip47WalletConnect.Nip47WalletConnect import com.vitorpamplona.quartz.nip50Search.SearchRelayListEvent import com.vitorpamplona.quartz.nip51Lists.favoriteAlgoFeedsList.FavoriteAlgoFeedsListEvent import com.vitorpamplona.quartz.nip51Lists.geohashList.GeohashListEvent -import com.vitorpamplona.quartz.nip51Lists.hashtagList.InterestListEvent +import com.vitorpamplona.quartz.nip51Lists.interestList.InterestListEvent import com.vitorpamplona.quartz.nip51Lists.muteList.MuteListEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.BlockedRelayListEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.FavoriteRelayListEvent @@ -599,7 +599,7 @@ object LocalPreferences { putOrRemove(PrefKeys.LATEST_NIP65_RELAY_LIST, settings.backupNIP65RelayList) putOrRemove(PrefKeys.LATEST_SEARCH_RELAY_LIST, settings.backupSearchRelayList) putOrRemove(PrefKeys.LATEST_INDEX_RELAY_LIST, settings.backupIndexRelayList) - putOrRemove(PrefKeys.LATEST_RELAY_FEEDS_LIST, settings.backupRelayFeedsList) + putOrRemove(PrefKeys.LATEST_RELAY_FEEDS_LIST, settings.backupFavoriteRelayList) putOrRemove(PrefKeys.LATEST_BLOCKED_RELAY_LIST, settings.backupBlockedRelayList) putOrRemove(PrefKeys.LATEST_TRUSTED_RELAY_LIST, settings.backupTrustedRelayList) @@ -613,9 +613,9 @@ object LocalPreferences { putOrRemove(PrefKeys.LATEST_PRIVATE_HOME_RELAY_LIST, settings.backupPrivateHomeRelayList) putOrRemove(PrefKeys.LATEST_APP_SPECIFIC_DATA, settings.backupAppSpecificData) - putOrRemove(PrefKeys.LATEST_CHANNEL_LIST, settings.backupChannelList) + putOrRemove(PrefKeys.LATEST_CHANNEL_LIST, settings.backupPublicChatList) putOrRemove(PrefKeys.LATEST_COMMUNITY_LIST, settings.backupCommunityList) - putOrRemove(PrefKeys.LATEST_HASHTAG_LIST, settings.backupHashtagList) + putOrRemove(PrefKeys.LATEST_HASHTAG_LIST, settings.backupInterestList) putOrRemove(PrefKeys.LATEST_GEOHASH_LIST, settings.backupGeohashList) putOrRemove(PrefKeys.LATEST_EPHEMERAL_LIST, settings.backupEphemeralChatList) putOrRemove(PrefKeys.LATEST_RELAY_GROUP_LIST, settings.backupRelayGroupList) @@ -827,15 +827,15 @@ object LocalPreferences { val latestNip65RelayListStr = getString(PrefKeys.LATEST_NIP65_RELAY_LIST, null) val latestSearchRelayListStr = getString(PrefKeys.LATEST_SEARCH_RELAY_LIST, null) val latestIndexRelayListStr = getString(PrefKeys.LATEST_INDEX_RELAY_LIST, null) - val latestRelayFeedsListStr = getString(PrefKeys.LATEST_RELAY_FEEDS_LIST, null) + val latestFavoriteRelayListStr = getString(PrefKeys.LATEST_RELAY_FEEDS_LIST, null) val latestBlockedRelayListStr = getString(PrefKeys.LATEST_BLOCKED_RELAY_LIST, null) val latestTrustedRelayListStr = getString(PrefKeys.LATEST_TRUSTED_RELAY_LIST, null) val latestMuteListStr = getString(PrefKeys.LATEST_MUTE_LIST, null) val latestPrivateHomeRelayListStr = getString(PrefKeys.LATEST_PRIVATE_HOME_RELAY_LIST, null) val latestAppSpecificDataStr = getString(PrefKeys.LATEST_APP_SPECIFIC_DATA, null) - val latestChannelListStr = getString(PrefKeys.LATEST_CHANNEL_LIST, null) + val latestPublicChatListStr = getString(PrefKeys.LATEST_CHANNEL_LIST, null) val latestCommunityListStr = getString(PrefKeys.LATEST_COMMUNITY_LIST, null) - val latestHashtagListStr = getString(PrefKeys.LATEST_HASHTAG_LIST, null) + val latestInterestListStr = getString(PrefKeys.LATEST_HASHTAG_LIST, null) val latestGeohashListStr = getString(PrefKeys.LATEST_GEOHASH_LIST, null) val latestEphemeralListStr = getString(PrefKeys.LATEST_EPHEMERAL_LIST, null) val latestRelayGroupListStr = getString(PrefKeys.LATEST_RELAY_GROUP_LIST, null) @@ -891,15 +891,15 @@ object LocalPreferences { val latestNip65RelayList = async { parseEventOrNull(latestNip65RelayListStr) } val latestSearchRelayList = async { parseEventOrNull(latestSearchRelayListStr) } val latestIndexRelayList = async { parseEventOrNull(latestIndexRelayListStr) } - val latestRelayFeedsList = async { parseEventOrNull(latestRelayFeedsListStr) } + val latestFavoriteRelayList = async { parseEventOrNull(latestFavoriteRelayListStr) } val latestBlockedRelayList = async { parseEventOrNull(latestBlockedRelayListStr) } val latestTrustedRelayList = async { parseEventOrNull(latestTrustedRelayListStr) } val latestMuteList = async { parseEventOrNull(latestMuteListStr) } val latestPrivateHomeRelayList = async { parseEventOrNull(latestPrivateHomeRelayListStr) } val latestAppSpecificData = async { parseEventOrNull(latestAppSpecificDataStr) } - val latestChannelList = async { parseEventOrNull(latestChannelListStr) } + val latestPublicChatList = async { parseEventOrNull(latestPublicChatListStr) } val latestCommunityList = async { parseEventOrNull(latestCommunityListStr) } - val latestHashtagList = async { parseEventOrNull(latestHashtagListStr) } + val latestInterestList = async { parseEventOrNull(latestInterestListStr) } val latestGeohashList = async { parseEventOrNull(latestGeohashListStr) } val latestEphemeralList = async { parseEventOrNull(latestEphemeralListStr) } val latestRelayGroupList = async { parseEventOrNull(latestRelayGroupListStr) } @@ -947,15 +947,15 @@ object LocalPreferences { val latestNip65RelayListResolved = latestNip65RelayList.await() val latestSearchRelayListResolved = latestSearchRelayList.await() val latestIndexRelayListResolved = latestIndexRelayList.await() - val latestRelayFeedsListResolved = latestRelayFeedsList.await() + val latestFavoriteRelayListResolved = latestFavoriteRelayList.await() val latestBlockedRelayListResolved = latestBlockedRelayList.await() val latestTrustedRelayListResolved = latestTrustedRelayList.await() val latestMuteListResolved = latestMuteList.await() val latestPrivateHomeRelayListResolved = latestPrivateHomeRelayList.await() val latestAppSpecificDataResolved = latestAppSpecificData.await() - val latestChannelListResolved = latestChannelList.await() + val latestPublicChatListResolved = latestPublicChatList.await() val latestCommunityListResolved = latestCommunityList.await() - val latestHashtagListResolved = latestHashtagList.await() + val latestInterestListResolved = latestInterestList.await() val latestGeohashListResolved = latestGeohashList.await() val latestEphemeralListResolved = latestEphemeralList.await() val latestRelayGroupListResolved = latestRelayGroupList.await() @@ -1049,15 +1049,15 @@ object LocalPreferences { backupDMRelayList = latestDmRelayListResolved, backupSearchRelayList = latestSearchRelayListResolved, backupIndexRelayList = latestIndexRelayListResolved, - backupRelayFeedsList = latestRelayFeedsListResolved, + backupFavoriteRelayList = latestFavoriteRelayListResolved, backupBlockedRelayList = latestBlockedRelayListResolved, backupTrustedRelayList = latestTrustedRelayListResolved, backupPrivateHomeRelayList = latestPrivateHomeRelayListResolved, backupMuteList = latestMuteListResolved, backupAppSpecificData = latestAppSpecificDataResolved, - backupChannelList = latestChannelListResolved, + backupPublicChatList = latestPublicChatListResolved, backupCommunityList = latestCommunityListResolved, - backupHashtagList = latestHashtagListResolved, + backupInterestList = latestInterestListResolved, backupGeohashList = latestGeohashListResolved, backupEphemeralChatList = latestEphemeralListResolved, backupRelayGroupList = latestRelayGroupListResolved, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt index 438be42d4f..b69ea5f2b1 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt @@ -75,21 +75,21 @@ import com.vitorpamplona.amethyst.commons.model.nip51Lists.blockPeopleList.Block import com.vitorpamplona.amethyst.commons.model.nip51Lists.blockedRelays.BlockedRelayListDecryptionCache import com.vitorpamplona.amethyst.commons.model.nip51Lists.broadcastRelays.BroadcastRelayListDecryptionCache import com.vitorpamplona.amethyst.commons.model.nip51Lists.favoriteAlgoFeedsLists.FavoriteAlgoFeedsListDecryptionCache +import com.vitorpamplona.amethyst.commons.model.nip51Lists.favoriteRelays.FavoriteRelayListDecryptionCache +import com.vitorpamplona.amethyst.commons.model.nip51Lists.followSets.FollowSetDecryptionCache import com.vitorpamplona.amethyst.commons.model.nip51Lists.geohashLists.GeohashListDecryptionCache -import com.vitorpamplona.amethyst.commons.model.nip51Lists.hashtagLists.HashtagListDecryptionCache import com.vitorpamplona.amethyst.commons.model.nip51Lists.indexerRelays.IndexerRelayListDecryptionCache +import com.vitorpamplona.amethyst.commons.model.nip51Lists.interestLists.InterestListDecryptionCache import com.vitorpamplona.amethyst.commons.model.nip51Lists.muteList.MuteListDecryptionCache -import com.vitorpamplona.amethyst.commons.model.nip51Lists.peopleList.PeopleListDecryptionCache import com.vitorpamplona.amethyst.commons.model.nip51Lists.proxyRelays.ProxyRelayListDecryptionCache -import com.vitorpamplona.amethyst.commons.model.nip51Lists.relayFeeds.RelayFeedsListDecryptionCache import com.vitorpamplona.amethyst.commons.model.nip51Lists.searchRelays.SearchRelayListDecryptionCache import com.vitorpamplona.amethyst.commons.model.nip51Lists.trustedRelays.TrustedRelayListDecryptionCache import com.vitorpamplona.amethyst.commons.model.nip56Reports.ReportAction import com.vitorpamplona.amethyst.commons.model.nip62Vanish.VanishRequestsState import com.vitorpamplona.amethyst.commons.model.nip72Communities.CommunityListDecryptionCache -import com.vitorpamplona.amethyst.commons.model.nip85TrustedAssertions.ContactCardDecryptionCache -import com.vitorpamplona.amethyst.commons.model.nip85TrustedAssertions.ContactCardsState import com.vitorpamplona.amethyst.commons.model.nip85TrustedAssertions.TrustProviderListDecryptionCache +import com.vitorpamplona.amethyst.commons.model.nip85TrustedAssertions.UserAssertionDecryptionCache +import com.vitorpamplona.amethyst.commons.model.nip85TrustedAssertions.UserAssertionsState import com.vitorpamplona.amethyst.commons.model.nipBCOnchainZaps.OnchainWalletState import com.vitorpamplona.amethyst.commons.model.privateChatLastReadRoute import com.vitorpamplona.amethyst.commons.model.privateChats.hasEncryptedContent @@ -145,18 +145,18 @@ import com.vitorpamplona.amethyst.model.nip46Signer.Nip46SignerState import com.vitorpamplona.amethyst.model.nip47WalletConnect.NwcSignerState import com.vitorpamplona.amethyst.model.nip51Lists.HiddenUsersState import com.vitorpamplona.amethyst.model.nip51Lists.blockedRelays.BlockedRelayListState +import com.vitorpamplona.amethyst.model.nip51Lists.bookmarkSets.BookmarkSetsState import com.vitorpamplona.amethyst.model.nip51Lists.broadcastRelays.BroadcastRelayListState import com.vitorpamplona.amethyst.model.nip51Lists.favoriteAlgoFeedsLists.FavoriteAlgoFeedsListState +import com.vitorpamplona.amethyst.model.nip51Lists.favoriteRelays.FavoriteRelayListState +import com.vitorpamplona.amethyst.model.nip51Lists.followSets.FollowSetsState +import com.vitorpamplona.amethyst.model.nip51Lists.followSets.StarterPacksState import com.vitorpamplona.amethyst.model.nip51Lists.geohashLists.GeohashListState -import com.vitorpamplona.amethyst.model.nip51Lists.hashtagLists.HashtagListState import com.vitorpamplona.amethyst.model.nip51Lists.indexerRelays.IndexerRelayListState +import com.vitorpamplona.amethyst.model.nip51Lists.interestLists.InterestListState import com.vitorpamplona.amethyst.model.nip51Lists.interestSets.InterestSetsState -import com.vitorpamplona.amethyst.model.nip51Lists.labeledBookmarkLists.LabeledBookmarkListsState import com.vitorpamplona.amethyst.model.nip51Lists.muteList.MuteListState -import com.vitorpamplona.amethyst.model.nip51Lists.peopleList.FollowListsState -import com.vitorpamplona.amethyst.model.nip51Lists.peopleList.PeopleListsState import com.vitorpamplona.amethyst.model.nip51Lists.proxyRelays.ProxyRelayListState -import com.vitorpamplona.amethyst.model.nip51Lists.relayFeeds.RelayFeedListState import com.vitorpamplona.amethyst.model.nip51Lists.searchRelays.SearchRelayListState import com.vitorpamplona.amethyst.model.nip51Lists.trustedRelays.TrustedRelayListState import com.vitorpamplona.amethyst.model.nip65RelayList.Nip65RelayListState @@ -281,8 +281,8 @@ import com.vitorpamplona.quartz.nip51Lists.bookmarkList.BookmarkListEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.tags.AddressBookmark import com.vitorpamplona.quartz.nip56Reports.ReportEvent import com.vitorpamplona.quartz.nip56Reports.ReportType -import com.vitorpamplona.quartz.nip57Zaps.LnZapPrivateEvent import com.vitorpamplona.quartz.nip57Zaps.PrivateZapCache +import com.vitorpamplona.quartz.nip57Zaps.PrivateZapEvent import com.vitorpamplona.quartz.nip57Zaps.ZapReceiptEvent import com.vitorpamplona.quartz.nip57Zaps.ZapRequestEvent import com.vitorpamplona.quartz.nip57Zaps.splits.ZapSplitSetup @@ -639,8 +639,8 @@ class Account( val indexerRelayListDecryptionCache = IndexerRelayListDecryptionCache(signer) val indexerRelayList = IndexerRelayListState(signer, cache, indexerRelayListDecryptionCache, scope, settings) - val relayFeedsListDecryptionCache = RelayFeedsListDecryptionCache(signer) - val relayFeedsList = RelayFeedListState(signer, cache, relayFeedsListDecryptionCache, scope, settings) + val favoriteRelayListDecryptionCache = FavoriteRelayListDecryptionCache(signer) + val favoriteRelayList = FavoriteRelayListState(signer, cache, favoriteRelayListDecryptionCache, scope, settings) val blockedRelayListDecryptionCache = BlockedRelayListDecryptionCache(signer) val blockedRelayList = BlockedRelayListState(signer, cache, blockedRelayListDecryptionCache, scope, settings) @@ -758,8 +758,8 @@ class Account( val communityListDecryptionCache = CommunityListDecryptionCache(signer) val communityList = CommunityListState(signer, cache, communityListDecryptionCache, scope, settings) - val hashtagListDecryptionCache = HashtagListDecryptionCache(signer) - val hashtagList = HashtagListState(signer, cache, hashtagListDecryptionCache, scope, settings) + val interestListDecryptionCache = InterestListDecryptionCache(signer) + val interestList = InterestListState(signer, cache, interestListDecryptionCache, scope, settings) val favoriteAlgoFeedsListDecryptionCache = FavoriteAlgoFeedsListDecryptionCache(signer) val favoriteAlgoFeedsList = FavoriteAlgoFeedsListState(signer, cache, favoriteAlgoFeedsListDecryptionCache, scope, settings) @@ -777,14 +777,14 @@ class Account( val trustProviderListDecryptionCache = TrustProviderListDecryptionCache(signer) val trustProviderList = TrustProviderListState(signer, cache, trustProviderListDecryptionCache, scope, settings) - val peopleListDecryptionCache = PeopleListDecryptionCache(signer) - val blockPeopleList = BlockPeopleListState(signer, cache, peopleListDecryptionCache, scope) - val peopleLists = PeopleListsState(signer, cache, peopleListDecryptionCache, scope) - val followLists = FollowListsState(signer, cache, scope) + val followSetDecryptionCache = FollowSetDecryptionCache(signer) + val blockPeopleList = BlockPeopleListState(signer, cache, followSetDecryptionCache, scope) + val followSets = FollowSetsState(signer, cache, followSetDecryptionCache, scope) + val starterPacks = StarterPacksState(signer, cache, scope) val hiddenUsers = HiddenUsersState(muteList.flow, blockPeopleList.flow, scope, settings) - val labeledBookmarkLists = LabeledBookmarkListsState(signer, cache, scope) + val bookmarkSets = BookmarkSetsState(signer, cache, scope) val interestSets = InterestSetsState(signer, cache, scope) val appRecommendations = AppRecommendationsState(signer, cache, scope) val oldBookmarkState = OldBookmarkListState(signer, cache, scope) @@ -795,8 +795,8 @@ class Account( val ownedEmojiPacks = OwnedEmojiPacksState(signer, cache, scope) // needs `emoji` above: nickname edits resolve :shortcodes: against the account's packs - val contactCardDecryptionCache = ContactCardDecryptionCache(signer) - val contactCards = ContactCardsState(signer, cache, contactCardDecryptionCache, emoji) + val userAssertionDecryptionCache = UserAssertionDecryptionCache(signer) + val userAssertions = UserAssertionsState(signer, cache, userAssertionDecryptionCache, emoji) val vanish = VanishRequestsState(signer, cache, client, scope) @@ -893,7 +893,7 @@ class Account( val followsPerRelay = FollowsPerOutboxRelay(kind3FollowList, blockedRelayList, proxyRelayList, cache, scope).flow // Merges all follow lists to create a single All Follows feed. - val allFollows = MergedFollowListsState(kind3FollowList, peopleLists, followLists, hashtagList, geohashList, communityList, scope) + val allFollows = MergedFollowListsState(kind3FollowList, followSets, starterPacks, interestList, geohashList, communityList, scope) val privateDMDecryptionCache = PrivateDMCache(signer) override val privateZapsDecryptionCache = PrivateZapCache(signer) @@ -1030,10 +1030,10 @@ class Account( val feedDecryptionCaches = FeedDecryptionCaches( - peopleListCache = peopleListDecryptionCache, + peopleListCache = followSetDecryptionCache, muteListCache = muteListDecryptionCache, communityListCache = communityListDecryptionCache, - hashtagCache = hashtagListDecryptionCache, + hashtagCache = interestListDecryptionCache, geohashCache = geohashListDecryptionCache, ) @@ -1047,7 +1047,7 @@ class Account( blockedRelays = blockedRelayList.flow, proxyRelays = proxyRelayList.flow, mineRelays = mineRelays.flow, - relayFeeds = relayFeedsList.flow, + relayFeeds = favoriteRelayList.flow, caches = feedDecryptionCaches, signer = signer, scope = scope, @@ -2126,9 +2126,9 @@ class Account( suspend fun unfollow(community: AddressableNote) = sendMyPublicAndPrivateOutbox(communityList.unfollow(community)) - suspend fun followHashtag(tag: String) = sendMyPublicAndPrivateOutbox(hashtagList.follow(tag)) + suspend fun followHashtag(tag: String) = sendMyPublicAndPrivateOutbox(interestList.follow(tag)) - suspend fun unfollowHashtag(tag: String) = sendMyPublicAndPrivateOutbox(hashtagList.unfollow(tag)) + suspend fun unfollowHashtag(tag: String) = sendMyPublicAndPrivateOutbox(interestList.unfollow(tag)) suspend fun followFavoriteAlgoFeed(dvm: AddressBookmark) = sendMyPublicAndPrivateOutbox(favoriteAlgoFeedsList.follow(dvm)) @@ -3440,11 +3440,11 @@ class Account( * encrypted in the content. `null` clears a field. Goes out through the * account's extended outbox relays. */ - suspend fun updateContactCardPetName( + suspend fun updateUserAssertionPetName( pubkeyHex: HexKey, petName: String?, summary: String?, - ) = sendMyPublicAndPrivateOutbox(contactCards.updatePetNameAndSummary(pubkeyHex, petName, summary)) + ) = sendMyPublicAndPrivateOutbox(userAssertions.updatePetNameAndSummary(pubkeyHex, petName, summary)) suspend fun showUser(pubkeyHex: HexKey) { sendMyPublicAndPrivateOutbox(blockPeopleList.showUser(pubkeyHex)) @@ -3550,7 +3550,7 @@ class Account( } } - suspend fun decryptZapOrNull(event: ZapRequestEvent): LnZapPrivateEvent? = if (event.isPrivateZap() && isWriteable()) privateZapsDecryptionCache.decryptPrivateZap(event) else null + suspend fun decryptZapOrNull(event: ZapRequestEvent): PrivateZapEvent? = if (event.isPrivateZap() && isWriteable()) privateZapsDecryptionCache.decryptPrivateZap(event) else null fun isAllHidden(users: Set): Boolean = users.all { isHidden(it) } @@ -3747,11 +3747,11 @@ class Account( suspend fun saveTrustedRelayList(trustedRelays: List) = sendMyPublicAndPrivateOutbox(trustedRelayList.saveRelayList(trustedRelays)) - suspend fun saveRelayFeedsList(trustedRelays: List) = sendMyPublicAndPrivateOutbox(relayFeedsList.saveRelayList(trustedRelays)) + suspend fun saveFavoriteRelayList(trustedRelays: List) = sendMyPublicAndPrivateOutbox(favoriteRelayList.saveRelayList(trustedRelays)) - suspend fun followRelayFeed(url: NormalizedRelayUrl) = sendMyPublicAndPrivateOutbox(relayFeedsList.addRelay(url)) + suspend fun followRelayFeed(url: NormalizedRelayUrl) = sendMyPublicAndPrivateOutbox(favoriteRelayList.addRelay(url)) - suspend fun unfollowRelayFeed(url: NormalizedRelayUrl) = sendMyPublicAndPrivateOutbox(relayFeedsList.removeRelay(url)) + suspend fun unfollowRelayFeed(url: NormalizedRelayUrl) = sendMyPublicAndPrivateOutbox(favoriteRelayList.removeRelay(url)) suspend fun saveBlockedRelayList(blockedRelays: List) = sendMyPublicAndPrivateOutbox(blockedRelayList.saveRelayList(blockedRelays)) @@ -3783,7 +3783,7 @@ class Account( proxyRelayList.getProxyRelayList(), broadcastRelayList.getBroadcastRelayList(), indexerRelayList.getIndexerRelayList(), - relayFeedsList.getRelayFeedsList(), + favoriteRelayList.getFavoriteRelayList(), blockedRelayList.getBlockedRelayList(), muteList.getMuteList(), bookmarkState.getBookmarkList(), @@ -4056,9 +4056,9 @@ class Account( logTime("Account ${userProfile().toBestDisplayName()} newEventBundle Update with ${newNotes.size} new notes") { upgradeAttestations() newNotesPreProcessor.runNew(newNotes) - peopleLists.newNotes(newNotes) - followLists.newNotes(newNotes) - labeledBookmarkLists.newNotes(newNotes) + followSets.newNotes(newNotes) + starterPacks.newNotes(newNotes) + bookmarkSets.newNotes(newNotes) interestSets.newNotes(newNotes) ownedEmojiPacks.newNotes(newNotes) } @@ -4069,9 +4069,9 @@ class Account( cache.live.deletedEventBundles.collect { deletedNotes -> logTime("Account ${userProfile().toBestDisplayName()} deletedEventBundle Update with ${deletedNotes.size} new notes") { newNotesPreProcessor.runDeleted(deletedNotes) - peopleLists.deletedNotes(deletedNotes) - followLists.deletedNotes(deletedNotes) - labeledBookmarkLists.deletedNotes(deletedNotes) + followSets.deletedNotes(deletedNotes) + starterPacks.deletedNotes(deletedNotes) + bookmarkSets.deletedNotes(deletedNotes) interestSets.deletedNotes(deletedNotes) ownedEmojiPacks.deletedNotes(deletedNotes) } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/AccountSettings.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/AccountSettings.kt index b70197390c..b6e63d83e4 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/AccountSettings.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/AccountSettings.kt @@ -68,7 +68,7 @@ import com.vitorpamplona.quartz.nip47WalletConnect.Nip47WalletConnect import com.vitorpamplona.quartz.nip50Search.SearchRelayListEvent import com.vitorpamplona.quartz.nip51Lists.favoriteAlgoFeedsList.FavoriteAlgoFeedsListEvent import com.vitorpamplona.quartz.nip51Lists.geohashList.GeohashListEvent -import com.vitorpamplona.quartz.nip51Lists.hashtagList.InterestListEvent +import com.vitorpamplona.quartz.nip51Lists.interestList.InterestListEvent import com.vitorpamplona.quartz.nip51Lists.muteList.MuteListEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.BlockedRelayListEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.FavoriteRelayListEvent @@ -208,15 +208,15 @@ class AccountSettings( var backupNIP65RelayList: AdvertisedRelayListEvent? = null, var backupSearchRelayList: SearchRelayListEvent? = null, var backupIndexRelayList: IndexerRelayListEvent? = null, - var backupRelayFeedsList: FavoriteRelayListEvent? = null, + var backupFavoriteRelayList: FavoriteRelayListEvent? = null, var backupBlockedRelayList: BlockedRelayListEvent? = null, var backupTrustedRelayList: TrustedRelayListEvent? = null, var backupMuteList: MuteListEvent? = null, var backupPrivateHomeRelayList: PrivateOutboxRelayListEvent? = null, var backupAppSpecificData: AppSpecificDataEvent? = null, - var backupChannelList: PublicChatListEvent? = null, + var backupPublicChatList: PublicChatListEvent? = null, var backupCommunityList: CommunityListEvent? = null, - var backupHashtagList: InterestListEvent? = null, + var backupInterestList: InterestListEvent? = null, var backupFavoriteAlgoFeedsList: FavoriteAlgoFeedsListEvent? = null, var backupGeohashList: GeohashListEvent? = null, var backupEphemeralChatList: EphemeralChatListEvent? = null, @@ -1084,13 +1084,13 @@ class AccountSettings( is Bolt12OfferListEvent -> updateBolt12Offers(incoming) is SearchRelayListEvent -> updateSearchRelayList(incoming) is IndexerRelayListEvent -> updateIndexRelayList(incoming) - is FavoriteRelayListEvent -> updateRelayFeedList(incoming) + is FavoriteRelayListEvent -> updateFavoriteRelayList(incoming) is BlockedRelayListEvent -> updateBlockedRelayList(incoming) is TrustedRelayListEvent -> updateTrustedRelayList(incoming) is PrivateOutboxRelayListEvent -> updatePrivateHomeRelayList(incoming) - is PublicChatListEvent -> updateChannelListTo(incoming) + is PublicChatListEvent -> updatePublicChatListTo(incoming) is GeohashListEvent -> updateGeohashListTo(incoming) - is InterestListEvent -> updateHashtagListTo(incoming) + is InterestListEvent -> updateInterestListTo(incoming) is FavoriteAlgoFeedsListEvent -> updateFavoriteAlgoFeedsListTo(incoming) is CommunityListEvent -> updateCommunityListTo(incoming) is EphemeralChatListEvent -> updateEphemeralChatListTo(incoming) @@ -1284,11 +1284,11 @@ class AccountSettings( } } - fun updateRelayFeedList(newRelayFeedList: FavoriteRelayListEvent?) { - if (newRelayFeedList == null) return + fun updateFavoriteRelayList(newFavoriteRelayList: FavoriteRelayListEvent?) { + if (newFavoriteRelayList == null) return - if (backupGuard.accept(backupRelayFeedsList, newRelayFeedList, isEmpty = newRelayFeedList.tags.isEmpty()) { updateRelayFeedList(newRelayFeedList) }) { - backupRelayFeedsList = newRelayFeedList + if (backupGuard.accept(backupFavoriteRelayList, newFavoriteRelayList, isEmpty = newFavoriteRelayList.tags.isEmpty()) { updateFavoriteRelayList(newFavoriteRelayList) }) { + backupFavoriteRelayList = newFavoriteRelayList saveAccountSettings() } } @@ -1320,13 +1320,13 @@ class AccountSettings( } } - override fun channelList() = backupChannelList + override fun publicChatList() = backupPublicChatList - override fun updateChannelListTo(newChannelList: PublicChatListEvent?) { - if (newChannelList == null) return + override fun updatePublicChatListTo(newPublicChatList: PublicChatListEvent?) { + if (newPublicChatList == null) return - if (backupGuard.accept(backupChannelList, newChannelList, isEmpty = newChannelList.tags.isEmpty()) { updateChannelListTo(newChannelList) }) { - backupChannelList = newChannelList + if (backupGuard.accept(backupPublicChatList, newPublicChatList, isEmpty = newPublicChatList.tags.isEmpty()) { updatePublicChatListTo(newPublicChatList) }) { + backupPublicChatList = newPublicChatList saveAccountSettings() } } @@ -1340,11 +1340,11 @@ class AccountSettings( } } - fun updateHashtagListTo(newHashtagList: InterestListEvent?) { - if (newHashtagList == null) return + fun updateInterestListTo(newInterestList: InterestListEvent?) { + if (newInterestList == null) return - if (backupGuard.accept(backupHashtagList, newHashtagList, isEmpty = newHashtagList.tags.isEmpty()) { updateHashtagListTo(newHashtagList) }) { - backupHashtagList = newHashtagList + if (backupGuard.accept(backupInterestList, newInterestList, isEmpty = newInterestList.tags.isEmpty()) { updateInterestListTo(newInterestList) }) { + backupInterestList = newInterestList saveAccountSettings() } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/EventBroadcaster.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/EventBroadcaster.kt index 9765753489..c5a8d6737c 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/EventBroadcaster.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/EventBroadcaster.kt @@ -45,7 +45,7 @@ import com.vitorpamplona.quartz.nip29RelayGroups.isGroupScoped import com.vitorpamplona.quartz.nip37Drafts.DraftWrapEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.BookmarkListEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.OldBookmarkListEvent -import com.vitorpamplona.quartz.nip51Lists.labeledBookmarkList.BookmarkSetEvent +import com.vitorpamplona.quartz.nip51Lists.bookmarkSet.BookmarkSetEvent import com.vitorpamplona.quartz.nip53LiveActivities.meetingSpaces.MeetingRoomEvent import com.vitorpamplona.quartz.nip53LiveActivities.meetingSpaces.MeetingSpaceEvent import com.vitorpamplona.quartz.nip53LiveActivities.streaming.LiveActivitiesEvent diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/labeledBookmarkLists/LabeledBookmarkListsState.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/bookmarkSets/BookmarkSetsState.kt similarity index 80% rename from amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/labeledBookmarkLists/LabeledBookmarkListsState.kt rename to amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/bookmarkSets/BookmarkSetsState.kt index 49a1c8b3d4..305f9c26e0 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/labeledBookmarkLists/LabeledBookmarkListsState.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/bookmarkSets/BookmarkSetsState.kt @@ -18,7 +18,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.amethyst.model.nip51Lists.labeledBookmarkLists +package com.vitorpamplona.amethyst.model.nip51Lists.bookmarkSets import com.vitorpamplona.amethyst.commons.model.AddressableNote import com.vitorpamplona.amethyst.commons.model.Note @@ -27,7 +27,7 @@ import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.cache.filter import com.vitorpamplona.amethyst.commons.model.eventIdSet import com.vitorpamplona.amethyst.commons.model.events -import com.vitorpamplona.amethyst.commons.model.nip51Lists.labeledBookmarkLists.LabeledBookmarkList +import com.vitorpamplona.amethyst.commons.model.nip51Lists.bookmarkSets.BookmarkSet import com.vitorpamplona.amethyst.commons.model.updateFlow import com.vitorpamplona.amethyst.model.Account import com.vitorpamplona.quartz.nip01Core.core.Address @@ -37,10 +37,10 @@ import com.vitorpamplona.quartz.nip09Deletions.DeletionRequestEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.tags.AddressBookmark import com.vitorpamplona.quartz.nip51Lists.bookmarkList.tags.BookmarkIdTag import com.vitorpamplona.quartz.nip51Lists.bookmarkList.tags.EventBookmark -import com.vitorpamplona.quartz.nip51Lists.labeledBookmarkList.BookmarkSetEvent -import com.vitorpamplona.quartz.nip51Lists.labeledBookmarkList.description -import com.vitorpamplona.quartz.nip51Lists.labeledBookmarkList.image -import com.vitorpamplona.quartz.nip51Lists.labeledBookmarkList.title +import com.vitorpamplona.quartz.nip51Lists.bookmarkSet.BookmarkSetEvent +import com.vitorpamplona.quartz.nip51Lists.bookmarkSet.description +import com.vitorpamplona.quartz.nip51Lists.bookmarkSet.image +import com.vitorpamplona.quartz.nip51Lists.bookmarkSet.title import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.ExperimentalCoroutinesApi @@ -55,41 +55,41 @@ import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.flow.transformLatest import kotlinx.coroutines.flow.update -class LabeledBookmarkListsState( +class BookmarkSetsState( val signer: NostrSigner, val cache: LocalCache, val scope: CoroutineScope, ) { val user = cache.getOrCreateUser(signer.pubKey) - fun existingLabeledBookmarkNotes() = cache.addressables.filter(BookmarkSetEvent.KIND, user.pubkeyHex) + fun existingBookmarkSetNotes() = cache.addressables.filter(BookmarkSetEvent.KIND, user.pubkeyHex) - val labeledBookmarkListVersions = MutableStateFlow(0) + val bookmarkSetVersions = MutableStateFlow(0) - val labeledBookmarkListNotes = - labeledBookmarkListVersions - .map { existingLabeledBookmarkNotes() } - .onStart { emit(existingLabeledBookmarkNotes()) } + val bookmarkSetNotes = + bookmarkSetVersions + .map { existingBookmarkSetNotes() } + .onStart { emit(existingBookmarkSetNotes()) } .flowOn(Dispatchers.IO) .stateIn(scope, SharingStarted.Eagerly, emptyList()) - val labeledBookmarkListEventIds = - labeledBookmarkListNotes + val bookmarkSetEventIds = + bookmarkSetNotes .map { it.eventIdSet() } - .onStart { emit(labeledBookmarkListNotes.value.eventIdSet()) } + .onStart { emit(bookmarkSetNotes.value.eventIdSet()) } .flowOn(Dispatchers.IO) .stateIn(scope, SharingStarted.Eagerly, emptySet()) @OptIn(ExperimentalCoroutinesApi::class) val latestBookmarkLists: StateFlow> = - labeledBookmarkListNotes + bookmarkSetNotes .transformLatest { emitAll(it.updateFlow()) } - .onStart { emit(labeledBookmarkListNotes.value.events()) } + .onStart { emit(bookmarkSetNotes.value.events()) } .flowOn(Dispatchers.IO) .stateIn(scope, SharingStarted.Eagerly, emptyList()) - suspend fun BookmarkSetEvent.toLabeledBookmarkList() = - LabeledBookmarkList( + suspend fun BookmarkSetEvent.toBookmarkSet() = + BookmarkSet( identifier = dTag(), title = titleOrName() ?: dTag(), description = description(), @@ -98,23 +98,23 @@ class LabeledBookmarkListsState( publicBookmarks = publicBookmarks().toSet(), ) - suspend fun List.toLabeledBookmarkListsFeed() = map { it.toLabeledBookmarkList() }.sortedBy { it.title } + suspend fun List.toBookmarkSetsFeed() = map { it.toBookmarkSet() }.sortedBy { it.title } val listFeedFlow = latestBookmarkLists - .map { it.toLabeledBookmarkListsFeed() } - .onStart { emit(latestBookmarkLists.value.toLabeledBookmarkListsFeed()) } + .map { it.toBookmarkSetsFeed() } + .onStart { emit(latestBookmarkLists.value.toBookmarkSetsFeed()) } .flowOn(Dispatchers.IO) .stateIn(scope, SharingStarted.Eagerly, emptyList()) - fun List.getList(bookmarkListId: String) = + fun List.getList(bookmarkListId: String) = this.firstOrNull { it.identifier == bookmarkListId } fun getBookmarkList(dTag: String) = listFeedFlow.value.getList(bookmarkListId = dTag) - fun DeletionRequestEvent.hasAnyDeletedBookmarkLists() = deleteAddressesWithKind(BookmarkSetEvent.KIND) || deletesAnyEventIn(labeledBookmarkListEventIds.value) + fun DeletionRequestEvent.hasAnyDeletedBookmarkLists() = deleteAddressesWithKind(BookmarkSetEvent.KIND) || deletesAnyEventIn(bookmarkSetEventIds.value) fun hasItemInNoteList(notes: Set): Boolean = notes.anyNotNullEvent { event -> @@ -138,14 +138,14 @@ class LabeledBookmarkListsState( } fun forceRefresh() { - labeledBookmarkListVersions.update { it + 1 } + bookmarkSetVersions.update { it + 1 } } - fun getLabeledBookmarkListNote(bookmarkIdentifier: String): AddressableNote? = existingLabeledBookmarkNotes().find { it.dTag() == bookmarkIdentifier } + fun getBookmarkSetNote(bookmarkIdentifier: String): AddressableNote? = existingBookmarkSetNotes().find { it.dTag() == bookmarkIdentifier } - fun getLabeledBookmarkListEvent(bookmarkIdentifier: String): BookmarkSetEvent = getLabeledBookmarkListNote(bookmarkIdentifier)?.event as BookmarkSetEvent + fun getBookmarkSetEvent(bookmarkIdentifier: String): BookmarkSetEvent = getBookmarkSetNote(bookmarkIdentifier)?.event as BookmarkSetEvent - fun getLabeledBookmarkListFlow(bookmarkIdentifier: String) = + fun getBookmarkSetFlow(bookmarkIdentifier: String) = listFeedFlow .map { it.getList(bookmarkIdentifier) } .onStart { @@ -154,7 +154,7 @@ class LabeledBookmarkListsState( ) }.flowOn(Dispatchers.IO) - suspend fun addLabeledBookmarkList( + suspend fun addBookmarkSet( listName: String, listDescription: String? = null, listImage: String? = null, @@ -178,10 +178,10 @@ class LabeledBookmarkListsState( listName: String?, listDescription: String?, listImage: String?, - bookmarkList: LabeledBookmarkList, + bookmarkList: BookmarkSet, account: Account, ) { - val listEvent = getLabeledBookmarkListEvent(bookmarkList.identifier) + val listEvent = getBookmarkSetEvent(bookmarkList.identifier) val template = listEvent.update { @@ -197,10 +197,10 @@ class LabeledBookmarkListsState( suspend fun renameBookmarkList( newName: String, - bookmarkList: LabeledBookmarkList, + bookmarkList: BookmarkSet, account: Account, ) { - val listEvent = getLabeledBookmarkListEvent(bookmarkList.identifier) + val listEvent = getBookmarkSetEvent(bookmarkList.identifier) val renamedList = BookmarkSetEvent.modifyName( earlierVersion = listEvent, @@ -212,10 +212,10 @@ class LabeledBookmarkListsState( suspend fun modifyListDescription( newDescription: String?, - bookmarkList: LabeledBookmarkList, + bookmarkList: BookmarkSet, account: Account, ) { - val listEvent = getLabeledBookmarkListEvent(bookmarkList.identifier) + val listEvent = getBookmarkSetEvent(bookmarkList.identifier) val modifiedList = BookmarkSetEvent.modifyDescription( earlierVersion = listEvent, @@ -226,7 +226,7 @@ class LabeledBookmarkListsState( } suspend fun cloneBookmarkList( - currentBookmarkList: LabeledBookmarkList, + currentBookmarkList: BookmarkSet, customCloneName: String?, customCloneDescription: String?, account: Account, @@ -246,7 +246,7 @@ class LabeledBookmarkListsState( bookmarkListIdentifier: String, account: Account, ) { - val listEvent = getLabeledBookmarkListEvent(bookmarkListIdentifier) + val listEvent = getBookmarkSetEvent(bookmarkListIdentifier) val deletionEventTemplate = DeletionRequestEvent.build(listOf(listEvent)) val deletionEvent = account.signer.sign(deletionEventTemplate) account.sendMyPublicAndPrivateOutbox(deletionEvent) @@ -258,7 +258,7 @@ class LabeledBookmarkListsState( isBookmarkPrivate: Boolean, account: Account, ) { - val currentBookmarkList = getLabeledBookmarkListEvent(bookmarkListIdentifier) + val currentBookmarkList = getBookmarkSetEvent(bookmarkListIdentifier) val updatedList = BookmarkSetEvent.addBookmark( earlierVersion = currentBookmarkList, @@ -275,7 +275,7 @@ class LabeledBookmarkListsState( isBookmarkCurrentlyPrivate: Boolean, account: Account, ) { - val bookmarkList = getLabeledBookmarkListEvent(bookmarkListIdentifier) + val bookmarkList = getBookmarkSetEvent(bookmarkListIdentifier) val updatedList = BookmarkSetEvent.moveBookmark( earlierVersion = bookmarkList, @@ -292,7 +292,7 @@ class LabeledBookmarkListsState( isBookmarkPrivate: Boolean, account: Account, ) { - val currentBookmarkList = getLabeledBookmarkListEvent(bookmarkListIdentifier) + val currentBookmarkList = getBookmarkSetEvent(bookmarkListIdentifier) val updatedList = BookmarkSetEvent.removeBookmark( earlierVersion = currentBookmarkList, @@ -311,7 +311,7 @@ class LabeledBookmarkListsState( ) { if (deletedEventIds.isEmpty() && deletedAddresses.isEmpty()) return - val currentList = getLabeledBookmarkListNote(bookmarkListIdentifier)?.event as? BookmarkSetEvent ?: return + val currentList = getBookmarkSetNote(bookmarkListIdentifier)?.event as? BookmarkSetEvent ?: return val newPublicTags = currentList.tags diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/relayFeeds/RelayFeedListState.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/favoriteRelays/FavoriteRelayListState.kt similarity index 65% rename from amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/relayFeeds/RelayFeedListState.kt rename to amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/favoriteRelays/FavoriteRelayListState.kt index 685e8411a9..2f0fa88e44 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/relayFeeds/RelayFeedListState.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/favoriteRelays/FavoriteRelayListState.kt @@ -18,12 +18,12 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.amethyst.model.nip51Lists.relayFeeds +package com.vitorpamplona.amethyst.model.nip51Lists.favoriteRelays import com.vitorpamplona.amethyst.commons.model.Note import com.vitorpamplona.amethyst.commons.model.NoteState import com.vitorpamplona.amethyst.commons.model.cache.LocalCache -import com.vitorpamplona.amethyst.commons.model.nip51Lists.relayFeeds.RelayFeedsListDecryptionCache +import com.vitorpamplona.amethyst.commons.model.nip51Lists.favoriteRelays.FavoriteRelayListDecryptionCache import com.vitorpamplona.amethyst.model.AccountSettings import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl import com.vitorpamplona.quartz.nip01Core.signers.NostrSigner @@ -40,32 +40,32 @@ import kotlinx.coroutines.flow.onStart import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.launch -class RelayFeedListState( +class FavoriteRelayListState( val signer: NostrSigner, val cache: LocalCache, - val decryptionCache: RelayFeedsListDecryptionCache, + val decryptionCache: FavoriteRelayListDecryptionCache, val scope: CoroutineScope, val settings: AccountSettings, ) { // Creates a long-term reference for this note so that the GC doesn't collect the note it self - val relayFeedListNote = cache.getOrCreateAddressableNote(getRelayFeedsListAddress()) + val favoriteRelayListNote = cache.getOrCreateAddressableNote(getFavoriteRelayListAddress()) - fun getRelayFeedsListAddress() = FavoriteRelayListEvent.createAddress(signer.pubKey) + fun getFavoriteRelayListAddress() = FavoriteRelayListEvent.createAddress(signer.pubKey) - fun getRelayFeedsListFlow(): StateFlow = relayFeedListNote.flow().metadata.stateFlow + fun getFavoriteRelayListFlow(): StateFlow = favoriteRelayListNote.flow().metadata.stateFlow - fun getRelayFeedsList(): FavoriteRelayListEvent? = relayFeedListNote.event as? FavoriteRelayListEvent + fun getFavoriteRelayList(): FavoriteRelayListEvent? = favoriteRelayListNote.event as? FavoriteRelayListEvent - fun relayFeedsListEvent(note: Note) = note.event as? FavoriteRelayListEvent ?: settings.backupRelayFeedsList + fun favoriteRelayListEvent(note: Note) = note.event as? FavoriteRelayListEvent ?: settings.backupFavoriteRelayList - suspend fun normalizeRelayFeedsListWithBackup(note: Note): Set = relayFeedsListEvent(note)?.let { decryptionCache.relays(it) }?.ifEmpty { null } ?: emptySet() + suspend fun normalizeFavoriteRelayListWithBackup(note: Note): Set = favoriteRelayListEvent(note)?.let { decryptionCache.relays(it) }?.ifEmpty { null } ?: emptySet() - suspend fun normalizeRelayFeedsListWithBackupNoDefaults(note: Note): Set = relayFeedsListEvent(note)?.let { decryptionCache.relays(it) } ?: emptySet() + suspend fun normalizeFavoriteRelayListWithBackupNoDefaults(note: Note): Set = favoriteRelayListEvent(note)?.let { decryptionCache.relays(it) } ?: emptySet() val flow = - getRelayFeedsListFlow() - .map { normalizeRelayFeedsListWithBackup(it.note) } - .onStart { emit(normalizeRelayFeedsListWithBackup(relayFeedListNote)) } + getFavoriteRelayListFlow() + .map { normalizeFavoriteRelayListWithBackup(it.note) } + .onStart { emit(normalizeFavoriteRelayListWithBackup(favoriteRelayListNote)) } .flowOn(Dispatchers.IO) .stateIn( scope, @@ -74,9 +74,9 @@ class RelayFeedListState( ) val flowNoDefaults = - getRelayFeedsListFlow() - .map { normalizeRelayFeedsListWithBackupNoDefaults(it.note) } - .onStart { emit(normalizeRelayFeedsListWithBackupNoDefaults(relayFeedListNote)) } + getFavoriteRelayListFlow() + .map { normalizeFavoriteRelayListWithBackupNoDefaults(it.note) } + .onStart { emit(normalizeFavoriteRelayListWithBackupNoDefaults(favoriteRelayListNote)) } .flowOn(Dispatchers.IO) .stateIn( scope, @@ -85,24 +85,24 @@ class RelayFeedListState( ) suspend fun addRelay(relay: NormalizedRelayUrl): FavoriteRelayListEvent { - val current = normalizeRelayFeedsListWithBackupNoDefaults(relayFeedListNote).toMutableList() + val current = normalizeFavoriteRelayListWithBackupNoDefaults(favoriteRelayListNote).toMutableList() if (relay !in current) current.add(relay) return saveRelayList(current) } suspend fun removeRelay(relay: NormalizedRelayUrl): FavoriteRelayListEvent? { - val current = normalizeRelayFeedsListWithBackupNoDefaults(relayFeedListNote).toMutableList() + val current = normalizeFavoriteRelayListWithBackupNoDefaults(favoriteRelayListNote).toMutableList() if (relay !in current) return null current.remove(relay) return saveRelayList(current) } suspend fun saveRelayList(relayFeeds: List): FavoriteRelayListEvent { - val relayFeedsList = getRelayFeedsList() + val favoriteRelayList = getFavoriteRelayList() - return if (relayFeedsList != null && relayFeedsList.tags.isNotEmpty()) { + return if (favoriteRelayList != null && favoriteRelayList.tags.isNotEmpty()) { FavoriteRelayListEvent.updateRelayList( - earlierVersion = relayFeedsList, + earlierVersion = favoriteRelayList, relays = relayFeeds, signer = signer, ) @@ -115,7 +115,7 @@ class RelayFeedListState( } init { - settings.backupRelayFeedsList?.let { + settings.backupFavoriteRelayList?.let { Log.d("AccountRegisterObservers") { "Loading saved relay feeds list ${it.toJson()}" } @OptIn(DelicateCoroutinesApi::class) scope.launch(Dispatchers.IO) { LocalCache.justConsumeMyOwnEvent(it) } @@ -123,10 +123,10 @@ class RelayFeedListState( scope.launch(Dispatchers.IO) { Log.d("AccountRegisterObservers", "Relay feeds list Collector Start") - getRelayFeedsListFlow().collect { + getFavoriteRelayListFlow().collect { Log.d("AccountRegisterObservers") { "Updating Relay feeds list for ${signer.pubKey}" } (it.note.event as? FavoriteRelayListEvent)?.let { - settings.updateRelayFeedList(it) + settings.updateFavoriteRelayList(it) } } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/peopleList/PeopleListsState.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/followSets/FollowSetsState.kt similarity index 95% rename from amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/peopleList/PeopleListsState.kt rename to amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/followSets/FollowSetsState.kt index bdd1731ab8..4b002aec38 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/peopleList/PeopleListsState.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/followSets/FollowSetsState.kt @@ -18,7 +18,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.amethyst.model.nip51Lists.peopleList +package com.vitorpamplona.amethyst.model.nip51Lists.followSets import com.vitorpamplona.amethyst.commons.model.AddressableNote import com.vitorpamplona.amethyst.commons.model.Note @@ -28,19 +28,19 @@ import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.cache.filter import com.vitorpamplona.amethyst.commons.model.eventIdSet import com.vitorpamplona.amethyst.commons.model.events -import com.vitorpamplona.amethyst.commons.model.nip51Lists.peopleList.PeopleList -import com.vitorpamplona.amethyst.commons.model.nip51Lists.peopleList.PeopleListDecryptionCache +import com.vitorpamplona.amethyst.commons.model.nip51Lists.followSets.FollowSetDecryptionCache +import com.vitorpamplona.amethyst.commons.model.nip51Lists.followSets.PeopleList import com.vitorpamplona.amethyst.commons.model.updateFlow import com.vitorpamplona.amethyst.model.Account import com.vitorpamplona.quartz.nip01Core.core.HexKey import com.vitorpamplona.quartz.nip01Core.signers.NostrSigner import com.vitorpamplona.quartz.nip01Core.signers.update import com.vitorpamplona.quartz.nip09Deletions.DeletionRequestEvent +import com.vitorpamplona.quartz.nip51Lists.followSet.FollowSetEvent +import com.vitorpamplona.quartz.nip51Lists.followSet.description +import com.vitorpamplona.quartz.nip51Lists.followSet.image +import com.vitorpamplona.quartz.nip51Lists.followSet.title import com.vitorpamplona.quartz.nip51Lists.muteList.tags.UserTag -import com.vitorpamplona.quartz.nip51Lists.peopleList.FollowSetEvent -import com.vitorpamplona.quartz.nip51Lists.peopleList.description -import com.vitorpamplona.quartz.nip51Lists.peopleList.image -import com.vitorpamplona.quartz.nip51Lists.peopleList.title import com.vitorpamplona.quartz.utils.flattenToSet import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -62,10 +62,10 @@ import java.util.UUID * * This class must receive updates from Large Cache as it receives new events. */ -class PeopleListsState( +class FollowSetsState( val signer: NostrSigner, val cache: LocalCache, - val decryptionCache: PeopleListDecryptionCache, + val decryptionCache: FollowSetDecryptionCache, val scope: CoroutineScope, ) { val user = cache.getOrCreateUser(signer.pubKey) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/peopleList/FollowListsState.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/followSets/StarterPacksState.kt similarity index 91% rename from amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/peopleList/FollowListsState.kt rename to amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/followSets/StarterPacksState.kt index fbcdfe4e46..881b97a43d 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/peopleList/FollowListsState.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/followSets/StarterPacksState.kt @@ -18,7 +18,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.amethyst.model.nip51Lists.peopleList +package com.vitorpamplona.amethyst.model.nip51Lists.followSets import com.vitorpamplona.amethyst.commons.model.AddressableNote import com.vitorpamplona.amethyst.commons.model.Note @@ -28,7 +28,7 @@ import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.cache.filter import com.vitorpamplona.amethyst.commons.model.eventIdSet import com.vitorpamplona.amethyst.commons.model.events -import com.vitorpamplona.amethyst.commons.model.nip51Lists.peopleList.PeopleList +import com.vitorpamplona.amethyst.commons.model.nip51Lists.followSets.PeopleList import com.vitorpamplona.amethyst.commons.model.updateFlow import com.vitorpamplona.amethyst.model.Account import com.vitorpamplona.quartz.nip01Core.core.HexKey @@ -36,14 +36,14 @@ import com.vitorpamplona.quartz.nip01Core.signers.NostrSigner import com.vitorpamplona.quartz.nip01Core.signers.update import com.vitorpamplona.quartz.nip01Core.tags.dTag.dTag import com.vitorpamplona.quartz.nip09Deletions.DeletionRequestEvent -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent -import com.vitorpamplona.quartz.nip51Lists.followList.description -import com.vitorpamplona.quartz.nip51Lists.followList.image -import com.vitorpamplona.quartz.nip51Lists.followList.person -import com.vitorpamplona.quartz.nip51Lists.followList.personFirst -import com.vitorpamplona.quartz.nip51Lists.followList.removePerson -import com.vitorpamplona.quartz.nip51Lists.followList.title import com.vitorpamplona.quartz.nip51Lists.muteList.tags.UserTag +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.description +import com.vitorpamplona.quartz.nip51Lists.starterPack.image +import com.vitorpamplona.quartz.nip51Lists.starterPack.person +import com.vitorpamplona.quartz.nip51Lists.starterPack.personFirst +import com.vitorpamplona.quartz.nip51Lists.starterPack.removePerson +import com.vitorpamplona.quartz.nip51Lists.starterPack.title import com.vitorpamplona.quartz.utils.flattenToSet import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -65,7 +65,7 @@ import java.util.UUID * * This class must receive updates from Large Cache as it receives new events. */ -class FollowListsState( +class StarterPacksState( val signer: NostrSigner, val cache: LocalCache, val scope: CoroutineScope, @@ -84,25 +84,25 @@ class FollowListsState( val followListVersions = MutableStateFlow(0) - val followListNotes = + val starterPackNotes = followListVersions .map { existingPeopleListNotes() } .onStart { emit(existingPeopleListNotes()) } .flowOn(Dispatchers.IO) .stateIn(scope, SharingStarted.Eagerly, emptyList()) - val followListsEventIds = - followListNotes + val starterPacksEventIds = + starterPackNotes .map { it.eventIdSet() } - .onStart { emit(followListNotes.value.eventIdSet()) } + .onStart { emit(starterPackNotes.value.eventIdSet()) } .flowOn(Dispatchers.IO) .stateIn(scope, SharingStarted.Eagerly, emptySet()) @OptIn(ExperimentalCoroutinesApi::class) val latestLists: StateFlow> = - followListNotes + starterPackNotes .transformLatest { emitAll(it.updateFlow()) } - .onStart { emit(followListNotes.value.events()) } + .onStart { emit(starterPackNotes.value.events()) } .flowOn(Dispatchers.IO) .stateIn(scope, SharingStarted.Eagerly, emptyList()) @@ -148,12 +148,12 @@ class FollowListsState( fun isUserInFollowSets(user: User): Boolean = allPeopleListProfiles.value.contains(user.pubkeyHex) - fun DeletionRequestEvent.hasDeletedAnyFollowList() = deleteAddressesWithKind(StarterPackEvent.KIND) || deletesAnyEventIn(followListsEventIds.value) + fun DeletionRequestEvent.hasDeletedAnyStarterPack() = deleteAddressesWithKind(StarterPackEvent.KIND) || deletesAnyEventIn(starterPacksEventIds.value) fun hasItemInNoteList(notes: Set): Boolean = notes.anyNotNullEvent { event -> if (event.pubKey == signer.pubKey) { - event is StarterPackEvent || (event is DeletionRequestEvent && event.hasDeletedAnyFollowList()) + event is StarterPackEvent || (event is DeletionRequestEvent && event.hasDeletedAnyStarterPack()) } else { false } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/hashtagLists/HashtagListState.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/interestLists/InterestListState.kt similarity index 80% rename from amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/hashtagLists/HashtagListState.kt rename to amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/interestLists/InterestListState.kt index 8ef88a5e24..25dcf8712b 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/hashtagLists/HashtagListState.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/nip51Lists/interestLists/InterestListState.kt @@ -18,15 +18,15 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.amethyst.model.nip51Lists.hashtagLists +package com.vitorpamplona.amethyst.model.nip51Lists.interestLists import com.vitorpamplona.amethyst.commons.model.Note import com.vitorpamplona.amethyst.commons.model.NoteState import com.vitorpamplona.amethyst.commons.model.cache.LocalCache -import com.vitorpamplona.amethyst.commons.model.nip51Lists.hashtagLists.HashtagListDecryptionCache +import com.vitorpamplona.amethyst.commons.model.nip51Lists.interestLists.InterestListDecryptionCache import com.vitorpamplona.amethyst.model.AccountSettings import com.vitorpamplona.quartz.nip01Core.signers.NostrSigner -import com.vitorpamplona.quartz.nip51Lists.hashtagList.InterestListEvent +import com.vitorpamplona.quartz.nip51Lists.interestList.InterestListEvent import com.vitorpamplona.quartz.utils.Log import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.DelicateCoroutinesApi @@ -40,30 +40,30 @@ import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.flow.transformLatest import kotlinx.coroutines.launch -class HashtagListState( +class InterestListState( val signer: NostrSigner, val cache: LocalCache, - val decryptionCache: HashtagListDecryptionCache, + val decryptionCache: InterestListDecryptionCache, val scope: CoroutineScope, val settings: AccountSettings, ) { // Creates a long-term reference for this note so that the GC doesn't collect the note it self - val hashtagListNote = cache.getOrCreateAddressableNote(getHashtagListAddress()) + val hashtagListNote = cache.getOrCreateAddressableNote(getInterestListAddress()) - fun getHashtagListAddress() = InterestListEvent.createAddress(signer.pubKey) + fun getInterestListAddress() = InterestListEvent.createAddress(signer.pubKey) - fun getHashtagListFlow(): StateFlow = hashtagListNote.flow().metadata.stateFlow + fun getInterestListFlow(): StateFlow = hashtagListNote.flow().metadata.stateFlow - fun getHashtagList(): InterestListEvent? = hashtagListNote.event as? InterestListEvent + fun getInterestList(): InterestListEvent? = hashtagListNote.event as? InterestListEvent suspend fun hashtagListWithBackup(note: Note): Set { - val event = note.event as? InterestListEvent ?: settings.backupHashtagList + val event = note.event as? InterestListEvent ?: settings.backupInterestList return event?.let { decryptionCache.hashtags(it).mapTo(mutableSetOf()) { it.lowercase() } } ?: emptySet() } @OptIn(ExperimentalCoroutinesApi::class) val flow: StateFlow> = - getHashtagListFlow() + getInterestListFlow() .transformLatest { noteState -> emit(hashtagListWithBackup(noteState.note)) }.onStart { @@ -76,7 +76,7 @@ class HashtagListState( ) suspend fun follow(hashtags: List): InterestListEvent { - val hashtagList = getHashtagList() + val hashtagList = getInterestList() return if (hashtagList == null) { InterestListEvent.create(hashtags, true, signer) @@ -86,7 +86,7 @@ class HashtagListState( } suspend fun follow(hashtag: String): InterestListEvent { - val hashtagList = getHashtagList() + val hashtagList = getInterestList() return if (hashtagList == null) { InterestListEvent.create(hashtag.lowercase(), true, signer) @@ -96,7 +96,7 @@ class HashtagListState( } suspend fun unfollow(hashtag: String): InterestListEvent? { - val hashtagList = getHashtagList() + val hashtagList = getInterestList() return if (hashtagList != null) { InterestListEvent.remove(hashtagList, hashtag, signer) @@ -106,7 +106,7 @@ class HashtagListState( } init { - settings.backupHashtagList?.let { event -> + settings.backupInterestList?.let { event -> Log.d("AccountRegisterObservers") { "Loading saved Hashtag list ${event.toJson()}" } @OptIn(DelicateCoroutinesApi::class) scope.launch(Dispatchers.IO) { @@ -116,10 +116,10 @@ class HashtagListState( scope.launch(Dispatchers.IO) { Log.d("AccountRegisterObservers", "Hashtag List Collector Start") - getHashtagListFlow().collect { + getInterestListFlow().collect { Log.d("AccountRegisterObservers") { "Hashtag List for ${signer.pubKey}" } (it.note.event as? InterestListEvent)?.let { - settings.updateHashtagListTo(it) + settings.updateInterestListTo(it) } } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/preferences/AccountPreferenceStores.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/preferences/AccountPreferenceStores.kt index c7fdad1616..ec7248a3b1 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/preferences/AccountPreferenceStores.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/preferences/AccountPreferenceStores.kt @@ -49,9 +49,9 @@ class AccountPreferenceStores( val latestMuteList = stringPreferencesKey("latestMuteList") val latestPrivateHomeRelayList = stringPreferencesKey("latestPrivateHomeRelayList") val latestAppSpecificData = stringPreferencesKey("latestAppSpecificData") - val latestChannelList = stringPreferencesKey("latestChannelList") + val latestPublicChatList = stringPreferencesKey("latestChannelList") val latestCommunityList = stringPreferencesKey("latestCommunityList") - val latestHashtagList = stringPreferencesKey("latestHashtagList") + val latestInterestList = stringPreferencesKey("latestHashtagList") val latestGeohashList = stringPreferencesKey("latestGeohashList") val latestEphemeralChatList = stringPreferencesKey("latestEphemeralChatList") diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/serverList/MergedFollowListsState.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/serverList/MergedFollowListsState.kt index 85a875363d..29ad3470c2 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/serverList/MergedFollowListsState.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/serverList/MergedFollowListsState.kt @@ -22,10 +22,10 @@ package com.vitorpamplona.amethyst.model.serverList import androidx.compose.runtime.Immutable import com.vitorpamplona.amethyst.model.nip02FollowLists.Kind3FollowListState +import com.vitorpamplona.amethyst.model.nip51Lists.followSets.FollowSetsState +import com.vitorpamplona.amethyst.model.nip51Lists.followSets.StarterPacksState import com.vitorpamplona.amethyst.model.nip51Lists.geohashLists.GeohashListState -import com.vitorpamplona.amethyst.model.nip51Lists.hashtagLists.HashtagListState -import com.vitorpamplona.amethyst.model.nip51Lists.peopleList.FollowListsState -import com.vitorpamplona.amethyst.model.nip51Lists.peopleList.PeopleListsState +import com.vitorpamplona.amethyst.model.nip51Lists.interestLists.InterestListState import com.vitorpamplona.amethyst.model.nip72Communities.CommunityListState import com.vitorpamplona.quartz.nip01Core.core.HexKey import com.vitorpamplona.quartz.nip72ModCommunities.follow.tags.CommunityTag @@ -44,9 +44,9 @@ import kotlinx.coroutines.flow.stateIn @Suppress("UNCHECKED_CAST") class MergedFollowListsState( val kind3List: Kind3FollowListState, - val peopleList: PeopleListsState, - val followList: FollowListsState, - val hashtagList: HashtagListState, + val followSets: FollowSetsState, + val starterPacks: StarterPacksState, + val interestList: InterestListState, val geohashList: GeohashListState, val communityList: CommunityListState, val scope: CoroutineScope, @@ -85,9 +85,9 @@ class MergedFollowListsState( combine( listOf( kind3List.flow, - peopleList.allGoodPeopleListProfiles, - followList.allPeopleListProfiles, - hashtagList.flow, + followSets.allGoodPeopleListProfiles, + starterPacks.allPeopleListProfiles, + interestList.flow, geohashList.flow, communityList.flow, ), @@ -104,9 +104,9 @@ class MergedFollowListsState( emit( mergeLists( kind3List.flow.value, - peopleList.allGoodPeopleListProfiles.value, - followList.allPeopleListProfiles.value, - hashtagList.flow.value, + followSets.allGoodPeopleListProfiles.value, + starterPacks.allPeopleListProfiles.value, + interestList.flow.value, geohashList.flow.value, communityList.flow.value, ), @@ -118,9 +118,9 @@ class MergedFollowListsState( SharingStarted.Eagerly, mergeLists( kind3List.flow.value, - peopleList.allGoodPeopleListProfiles.value, - followList.allPeopleListProfiles.value, - hashtagList.flow.value, + followSets.allGoodPeopleListProfiles.value, + starterPacks.allPeopleListProfiles.value, + interestList.flow.value, geohashList.flow.value, communityList.flow.value, ), diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/notifications/NotificationDispatcher.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/notifications/NotificationDispatcher.kt index e9bca8f358..b7f3b0908b 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/notifications/NotificationDispatcher.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/notifications/NotificationDispatcher.kt @@ -101,7 +101,7 @@ class NotificationDispatcher( private const val TAG = "NotificationDispatcher" // The dispatcher observes the *final* notification payload kinds. - // GiftWrap/EphemeralGiftWrap (1059/21059) and SealedRumor (13) are NOT + // GiftWrap/EphemeralGiftWrap (1059/21059) and Seal (13) are NOT // listed here — by the time we care, Account.newNotesPreProcessor has // already unwrapped them and inserted the inner payload into LocalCache, // which fires the observer a second time on the inner event. @@ -235,8 +235,8 @@ class NotificationDispatcher( if (event is WakeUpEvent) return@predicate true // getNoteIfExists(event) — not (event.id) — so - // AddressableEvent kinds (LongTextNote, WikiNote, - // LiveChess*, VideoHorizontal/Vertical) resolve to + // AddressableEvent kinds (LongFormContent, WikiArticle, + // LiveChess*, AddressableNormalVideo/AddressableShortVideo) resolve to // their address-keyed replaceable note. The id-keyed // version note has its replyTo moved away during // insertion (LocalCache.consumeBaseReplaceable), so diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/notifications/PushWrapDecryptor.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/notifications/PushWrapDecryptor.kt index 17964dbecd..356051c867 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/notifications/PushWrapDecryptor.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/notifications/PushWrapDecryptor.kt @@ -36,7 +36,7 @@ import kotlinx.coroutines.CancellationException * * Once decrypted, the inner event is fed into [LocalCache]. From there the * normal `Account.newNotesPreProcessor` → `GiftWrapEventHandler` → - * `SealedRumorEventHandler` chain unwraps any remaining layers, and + * `SealEventHandler` chain unwraps any remaining layers, and * [NotificationDispatcher] picks up the final payload and notifies. */ object PushWrapDecryptor { diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/account/metadata/FilterAccountInfoAndListsFromKey.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/account/metadata/FilterAccountInfoAndListsFromKey.kt index 75a9090d82..a4403f5659 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/account/metadata/FilterAccountInfoAndListsFromKey.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/account/metadata/FilterAccountInfoAndListsFromKey.kt @@ -20,7 +20,7 @@ */ package com.vitorpamplona.amethyst.service.relayClient.reqCommand.account.metadata -import com.vitorpamplona.amethyst.commons.relayClient.assemblers.filterContactCardsByAuthorInTheRelay +import com.vitorpamplona.amethyst.commons.relayClient.assemblers.filterUserAssertionsByAuthorInTheRelay import com.vitorpamplona.amethyst.commons.relayClient.subscriptions.ExplainedFilter import com.vitorpamplona.amethyst.commons.relayClient.subscriptions.SubPurpose import com.vitorpamplona.amethyst.model.nip78AppSpecific.AppSpecificState.Companion.APP_SPECIFIC_DATA_D_TAG @@ -37,7 +37,7 @@ import com.vitorpamplona.quartz.nip37Drafts.privateOutbox.PrivateOutboxRelayList import com.vitorpamplona.quartz.nip38UserStatus.UserStatusEvent import com.vitorpamplona.quartz.nip50Search.SearchRelayListEvent import com.vitorpamplona.quartz.nip51Lists.geohashList.GeohashListEvent -import com.vitorpamplona.quartz.nip51Lists.hashtagList.InterestListEvent +import com.vitorpamplona.quartz.nip51Lists.interestList.InterestListEvent import com.vitorpamplona.quartz.nip51Lists.interestSet.InterestSetEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.BlockedRelayListEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.BroadcastRelayListEvent @@ -141,7 +141,7 @@ fun filterAccountInfoAndListsFromKey( ), // The account's own kind:30382 contact cards (nicknames, NIP-44 encrypted). // Addressable — one card per target user — hence its own larger-limit filter. - filterContactCardsByAuthorInTheRelay( + filterUserAssertionsByAuthorInTheRelay( relay = relay, authors = pubkeys, since = since, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/user/UserObservers.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/user/UserObservers.kt index bd26b5ad5a..ba253f5585 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/user/UserObservers.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/user/UserObservers.kt @@ -39,7 +39,7 @@ import com.vitorpamplona.quartz.nip02FollowList.ContactListEvent import com.vitorpamplona.quartz.nip51Lists.PinListEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.BookmarkListEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.OldBookmarkListEvent -import com.vitorpamplona.quartz.nip51Lists.hashtagList.InterestListEvent +import com.vitorpamplona.quartz.nip51Lists.interestList.InterestListEvent import kotlinx.collections.immutable.ImmutableList import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.ExperimentalCoroutinesApi @@ -64,11 +64,11 @@ fun observeUserName( // Subscribe in the relay for changes in the metadata of this user. UserFinderFilterAssemblerSubscription(user, accountViewModel) - val contactCards = accountViewModel.account.contactCards - val flow = remember(user) { contactCards.displayNameFlow(user) } + val userAssertions = accountViewModel.account.userAssertions + val flow = remember(user) { userAssertions.displayNameFlow(user) } // Subscribe in the LocalCache for changes that arrive in the device - return flow.collectAsStateWithLifecycle(remember(user) { contactCards.cachedDisplayName(user) }) + return flow.collectAsStateWithLifecycle(remember(user) { userAssertions.cachedDisplayName(user) }) } /** @@ -83,10 +83,10 @@ fun observeUserNickname( user: User, accountViewModel: AccountViewModel, ): State { - val contactCards = accountViewModel.account.contactCards - val flow = remember(user) { contactCards.nicknameFlow(user) } + val userAssertions = accountViewModel.account.userAssertions + val flow = remember(user) { userAssertions.nicknameFlow(user) } - return flow.collectAsStateWithLifecycle(remember(user) { contactCards.cachedNickname(user) }) + return flow.collectAsStateWithLifecycle(remember(user) { userAssertions.cachedNickname(user) }) } @Composable @@ -132,9 +132,9 @@ fun observeUserTagFollowCount( .metadata.stateFlow .sample(1000) .mapLatest { noteState -> - (noteState.note.event as? InterestListEvent)?.let { accountViewModel.account.hashtagListDecryptionCache.hashtags(it) }?.size ?: 0 + (noteState.note.event as? InterestListEvent)?.let { accountViewModel.account.interestListDecryptionCache.hashtags(it) }?.size ?: 0 }.onStart { - emit((accountViewModel.hashtagFollows(user).event as? InterestListEvent)?.let { accountViewModel.account.hashtagListDecryptionCache.hashtags(it) }?.size ?: 0) + emit((accountViewModel.hashtagFollows(user).event as? InterestListEvent)?.let { accountViewModel.account.interestListDecryptionCache.hashtags(it) }?.size ?: 0) }.distinctUntilChanged() .flowOn(Dispatchers.IO) } @@ -160,9 +160,9 @@ fun observeUserTagFollows( .metadata.stateFlow .sample(200) .mapLatest { noteState -> - (noteState.note.event as? InterestListEvent)?.let { accountViewModel.account.hashtagListDecryptionCache.hashtags(it) }?.sorted() ?: emptyList() + (noteState.note.event as? InterestListEvent)?.let { accountViewModel.account.interestListDecryptionCache.hashtags(it) }?.sorted() ?: emptyList() }.onStart { - emit((accountViewModel.hashtagFollows(user).event as? InterestListEvent)?.let { accountViewModel.account.hashtagListDecryptionCache.hashtags(it) }?.sorted() ?: emptyList()) + emit((accountViewModel.hashtagFollows(user).event as? InterestListEvent)?.let { accountViewModel.account.interestListDecryptionCache.hashtags(it) }?.sorted() ?: emptyList()) }.distinctUntilChanged() .flowOn(Dispatchers.IO) } @@ -304,16 +304,16 @@ fun observeUserIsFollowingHashtag( // Subscribe in the LocalCache for changes that arrive in the device val flow = remember(accountViewModel) { - accountViewModel.account.hashtagList.flow + accountViewModel.account.interestList.flow .mapLatest { hashtags -> hashtag in hashtags }.onStart { - emit(hashtag in accountViewModel.account.hashtagList.flow.value) + emit(hashtag in accountViewModel.account.interestList.flow.value) }.distinctUntilChanged() .flowOn(Dispatchers.IO) } - return flow.collectAsStateWithLifecycle(hashtag in accountViewModel.account.hashtagList.flow.value) + return flow.collectAsStateWithLifecycle(hashtag in accountViewModel.account.interestList.flow.value) } @SuppressLint("StateFlowValueCalledInComposition") @@ -373,16 +373,16 @@ fun observeUserIsFollowingRelay( ): State { val flow = remember(accountViewModel) { - accountViewModel.account.relayFeedsList.flowNoDefaults + accountViewModel.account.favoriteRelayList.flowNoDefaults .mapLatest { relays -> relayUrl in relays }.onStart { - emit(relayUrl in accountViewModel.account.relayFeedsList.flowNoDefaults.value) + emit(relayUrl in accountViewModel.account.favoriteRelayList.flowNoDefaults.value) }.distinctUntilChanged() .flowOn(Dispatchers.IO) } - return flow.collectAsStateWithLifecycle(relayUrl in accountViewModel.account.relayFeedsList.flowNoDefaults.value) + return flow.collectAsStateWithLifecycle(relayUrl in accountViewModel.account.favoriteRelayList.flowNoDefaults.value) } @OptIn(ExperimentalCoroutinesApi::class, FlowPreview::class) @@ -439,7 +439,7 @@ fun observeUserIsFollowingChannel( @OptIn(ExperimentalCoroutinesApi::class, FlowPreview::class) @Composable -fun observeUserContactCardsScore( +fun observeUserAssertionsScore( user: User, accountViewModel: AccountViewModel, subscribe: Boolean = true, @@ -459,7 +459,7 @@ fun observeUserContactCardsScore( @OptIn(ExperimentalCoroutinesApi::class, FlowPreview::class) @Composable -fun observeUserContactCardsFollowerCount( +fun observeUserAssertionsFollowerCount( user: User, accountViewModel: AccountViewModel, ): State { diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/resourceusage/MeteringNostrSigner.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/resourceusage/MeteringNostrSigner.kt index 1b5355efef..8bfe2fe129 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/resourceusage/MeteringNostrSigner.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/resourceusage/MeteringNostrSigner.kt @@ -26,7 +26,7 @@ import com.vitorpamplona.quartz.nip01Core.signers.NostrSigner import com.vitorpamplona.quartz.nip01Core.signers.NostrSignerInternal import com.vitorpamplona.quartz.nip46RemoteSigner.signer.NostrSignerRemote import com.vitorpamplona.quartz.nip55AndroidSigner.client.NostrSignerExternal -import com.vitorpamplona.quartz.nip57Zaps.LnZapPrivateEvent +import com.vitorpamplona.quartz.nip57Zaps.PrivateZapEvent import com.vitorpamplona.quartz.nip57Zaps.ZapRequestEvent import com.vitorpamplona.quartz.nip89AppHandlers.clientTag.NostrSignerWithClientTag @@ -89,7 +89,7 @@ class MeteringNostrSigner( fromPublicKey: HexKey, ): String = metered(UsageKeys.DECRYPT_COUNT, UsageKeys.DECRYPT_US) { inner.nip44Decrypt(ciphertext, fromPublicKey) } - override suspend fun decryptZapEvent(event: ZapRequestEvent): LnZapPrivateEvent = metered(UsageKeys.DECRYPT_COUNT, UsageKeys.DECRYPT_US) { inner.decryptZapEvent(event) } + override suspend fun decryptZapEvent(event: ZapRequestEvent): PrivateZapEvent = metered(UsageKeys.DECRYPT_COUNT, UsageKeys.DECRYPT_US) { inner.decryptZapEvent(event) } override suspend fun deriveKey(nonce: HexKey): HexKey = inner.deriveKey(nonce) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/dal/FilterByListParams.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/dal/FilterByListParams.kt index 79d22a9dbe..9715816619 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/dal/FilterByListParams.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/dal/FilterByListParams.kt @@ -32,8 +32,8 @@ import com.vitorpamplona.quartz.nip01Core.core.HexKey import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl import com.vitorpamplona.quartz.nip01Core.tags.hashtags.hasMoreHashtagsThan import com.vitorpamplona.quartz.nip10Notes.threadRootIdOrSelf +import com.vitorpamplona.quartz.nip51Lists.followSet.FollowSetEvent import com.vitorpamplona.quartz.nip51Lists.muteList.MuteListEvent -import com.vitorpamplona.quartz.nip51Lists.peopleList.FollowSetEvent import com.vitorpamplona.quartz.utils.TimeUtils class FilterByListParams( diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/feeds/PrefetchFeedMedia.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/feeds/PrefetchFeedMedia.kt index 3d70cf26d2..c13a8124a8 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/feeds/PrefetchFeedMedia.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/feeds/PrefetchFeedMedia.kt @@ -303,7 +303,7 @@ private class WarmTargets { * `m` mime type (a hashed URL may carry no extension). The decode listener * records their dims like any other image. */ - fun addFileHeaderMedia(event: Event) { + fun addFileMetadataMedia(event: Event) { val urls = event.tags.mapNotNull(UrlTag::parse) if (urls.isEmpty()) return val imageMime = event.tags.firstNotNullOfOrNull(MimeTypeTag::parse)?.startsWith("image/") == true @@ -335,7 +335,7 @@ private fun Note.collectWarmTargets(): WarmTargets? { // NIP-94 file-header convention: the blob is a top-level `url` tag with sibling // `m`/`dim`, not imeta (FileMetadataEvent and the gallery/file kinds). The generic // imetas() above misses these entirely. - targets.addFileHeaderMedia(ev) + targets.addFileMetadataMedia(ev) // NIP-73 external-content scope. Only kind 1111 carries one, so the type check // keeps every other kind out of the tag walk. Reuses scope() — the same accessor diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/drawer/DrawerContent.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/drawer/DrawerContent.kt index a500753e1b..f7ad534111 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/drawer/DrawerContent.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/drawer/DrawerContent.kt @@ -146,7 +146,7 @@ import com.vitorpamplona.amethyst.commons.ui.theme.profileContentHeaderModifier import com.vitorpamplona.amethyst.isDebug import com.vitorpamplona.amethyst.model.Account import com.vitorpamplona.amethyst.service.relayClient.reqCommand.event.observeNote -import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUserContactCardsFollowerCount +import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUserAssertionsFollowerCount import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUserInfo import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUserStatuses import com.vitorpamplona.amethyst.ui.layouts.PermanentDrawerWidth @@ -587,7 +587,7 @@ fun DisplayFollowerCount( baseAccountUser: Account, accountViewModel: AccountViewModel, ) { - val followerCount by observeUserContactCardsFollowerCount(baseAccountUser.userProfile(), accountViewModel) + val followerCount by observeUserAssertionsFollowerCount(baseAccountUser.userProfile(), accountViewModel) Text( text = followerCount, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/routes/RouteMaker.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/routes/RouteMaker.kt index 3962bce3ac..198ff3adac 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/routes/RouteMaker.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/routes/RouteMaker.kt @@ -57,7 +57,7 @@ import com.vitorpamplona.quartz.nip34Git.pr.GitPullRequestEvent import com.vitorpamplona.quartz.nip34Git.pr.GitPullRequestUpdateEvent import com.vitorpamplona.quartz.nip34Git.repository.GitRepositoryEvent import com.vitorpamplona.quartz.nip37Drafts.DraftWrapEvent -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import com.vitorpamplona.quartz.nip53LiveActivities.chat.LiveActivitiesChatMessageEvent import com.vitorpamplona.quartz.nip53LiveActivities.streaming.LiveActivitiesEvent import com.vitorpamplona.quartz.nip57Zaps.ZapReceiptEvent diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/MultiSetCompose.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/MultiSetCompose.kt index 12c29afce3..a227d40fcb 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/MultiSetCompose.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/MultiSetCompose.kt @@ -106,7 +106,7 @@ import com.vitorpamplona.amethyst.commons.ui.theme.bitcoinColor import com.vitorpamplona.amethyst.commons.ui.theme.overPictureBackground import com.vitorpamplona.amethyst.commons.ui.theme.profile35dpModifier import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.UserFinderFilterAssemblerSubscription -import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUserContactCardsScore +import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUserAssertionsScore import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUserPicture import com.vitorpamplona.amethyst.ui.components.CoreSecretMessage import com.vitorpamplona.amethyst.ui.components.ExpandableRichTextViewer @@ -841,7 +841,7 @@ fun ObserveAndRenderBoxedUserCards( accountViewModel: AccountViewModel, subscribe: Boolean = true, ) { - val score by observeUserContactCardsScore(user, accountViewModel, subscribe) + val score by observeUserAssertionsScore(user, accountViewModel, subscribe) score?.let { Box(modifier = Size35Modifier, contentAlignment = Alignment.BottomCenter) { diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt index a05755b51f..29134ae6da 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt @@ -140,18 +140,18 @@ import com.vitorpamplona.amethyst.ui.note.types.DisplayBlockedRelayList import com.vitorpamplona.amethyst.ui.note.types.DisplayBroadcastRelayList import com.vitorpamplona.amethyst.ui.note.types.DisplayContactList import com.vitorpamplona.amethyst.ui.note.types.DisplayDMRelayList -import com.vitorpamplona.amethyst.ui.note.types.DisplayFollowList +import com.vitorpamplona.amethyst.ui.note.types.DisplayFavoriteRelayList import com.vitorpamplona.amethyst.ui.note.types.DisplayIndexerRelayList import com.vitorpamplona.amethyst.ui.note.types.DisplayNIP65RelayList import com.vitorpamplona.amethyst.ui.note.types.DisplayPeopleList import com.vitorpamplona.amethyst.ui.note.types.DisplayProxyRelayList -import com.vitorpamplona.amethyst.ui.note.types.DisplayRelayFeedsList import com.vitorpamplona.amethyst.ui.note.types.DisplayRelaySet import com.vitorpamplona.amethyst.ui.note.types.DisplaySearchRelayList +import com.vitorpamplona.amethyst.ui.note.types.DisplayStarterPack import com.vitorpamplona.amethyst.ui.note.types.DisplayTrustedRelayList import com.vitorpamplona.amethyst.ui.note.types.EditState import com.vitorpamplona.amethyst.ui.note.types.EmptyState -import com.vitorpamplona.amethyst.ui.note.types.FileHeaderDisplay +import com.vitorpamplona.amethyst.ui.note.types.FileMetadataDisplay import com.vitorpamplona.amethyst.ui.note.types.FileStorageHeaderDisplay import com.vitorpamplona.amethyst.ui.note.types.PictureDisplay import com.vitorpamplona.amethyst.ui.note.types.RenderAppDefinition @@ -180,6 +180,8 @@ import com.vitorpamplona.amethyst.ui.note.types.RenderCitation import com.vitorpamplona.amethyst.ui.note.types.RenderClassifieds import com.vitorpamplona.amethyst.ui.note.types.RenderCommunity import com.vitorpamplona.amethyst.ui.note.types.RenderCyberspaceBag +import com.vitorpamplona.amethyst.ui.note.types.RenderDvmContentDiscoveryResponse +import com.vitorpamplona.amethyst.ui.note.types.RenderDvmStatus import com.vitorpamplona.amethyst.ui.note.types.RenderEmojiPack import com.vitorpamplona.amethyst.ui.note.types.RenderEntityRating import com.vitorpamplona.amethyst.ui.note.types.RenderExternalReaction @@ -200,14 +202,11 @@ import com.vitorpamplona.amethyst.ui.note.types.RenderLiveActivityChatMessage import com.vitorpamplona.amethyst.ui.note.types.RenderLiveActivityEvent import com.vitorpamplona.amethyst.ui.note.types.RenderLiveChessChallenge import com.vitorpamplona.amethyst.ui.note.types.RenderLiveChessGameEnd -import com.vitorpamplona.amethyst.ui.note.types.RenderLnZap import com.vitorpamplona.amethyst.ui.note.types.RenderLongFormContent import com.vitorpamplona.amethyst.ui.note.types.RenderMeetingRoomEvent import com.vitorpamplona.amethyst.ui.note.types.RenderMeetingSpaceEvent import com.vitorpamplona.amethyst.ui.note.types.RenderMusicPlaylist import com.vitorpamplona.amethyst.ui.note.types.RenderMusicTrack -import com.vitorpamplona.amethyst.ui.note.types.RenderNIP90ContentDiscoveryResponse -import com.vitorpamplona.amethyst.ui.note.types.RenderNIP90Status import com.vitorpamplona.amethyst.ui.note.types.RenderNamedNappletEvent import com.vitorpamplona.amethyst.ui.note.types.RenderNamedSiteEvent import com.vitorpamplona.amethyst.ui.note.types.RenderNipContent @@ -257,21 +256,22 @@ import com.vitorpamplona.amethyst.ui.note.types.RenderWikiMergeAcceptance import com.vitorpamplona.amethyst.ui.note.types.RenderWikiMergeRequest import com.vitorpamplona.amethyst.ui.note.types.RenderWikiRedirect import com.vitorpamplona.amethyst.ui.note.types.RenderZapPoll +import com.vitorpamplona.amethyst.ui.note.types.RenderZapReceipt import com.vitorpamplona.amethyst.ui.note.types.ReplyRenderType import com.vitorpamplona.amethyst.ui.note.types.VideoDisplay import com.vitorpamplona.amethyst.ui.note.types.lists.RenderAppCurationSet import com.vitorpamplona.amethyst.ui.note.types.lists.RenderArticleCurationSet import com.vitorpamplona.amethyst.ui.note.types.lists.RenderBookmarkList +import com.vitorpamplona.amethyst.ui.note.types.lists.RenderBookmarkSet import com.vitorpamplona.amethyst.ui.note.types.lists.RenderFavoriteAlgoFeedsList import com.vitorpamplona.amethyst.ui.note.types.lists.RenderGeohashList import com.vitorpamplona.amethyst.ui.note.types.lists.RenderGitAuthorList import com.vitorpamplona.amethyst.ui.note.types.lists.RenderGitRepositoryList import com.vitorpamplona.amethyst.ui.note.types.lists.RenderGoodWikiAuthorList import com.vitorpamplona.amethyst.ui.note.types.lists.RenderGoodWikiRelayList -import com.vitorpamplona.amethyst.ui.note.types.lists.RenderHashtagList +import com.vitorpamplona.amethyst.ui.note.types.lists.RenderInterestList import com.vitorpamplona.amethyst.ui.note.types.lists.RenderInterestSet import com.vitorpamplona.amethyst.ui.note.types.lists.RenderKindMuteSet -import com.vitorpamplona.amethyst.ui.note.types.lists.RenderLabeledBookmarkList import com.vitorpamplona.amethyst.ui.note.types.lists.RenderMediaFollowList import com.vitorpamplona.amethyst.ui.note.types.lists.RenderMediaStarterPack import com.vitorpamplona.amethyst.ui.note.types.lists.RenderMuteList @@ -367,21 +367,20 @@ import com.vitorpamplona.quartz.nip51Lists.appCurationSet.AppCurationSetEvent import com.vitorpamplona.quartz.nip51Lists.articleCurationSet.ArticleCurationSetEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.BookmarkListEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.OldBookmarkListEvent +import com.vitorpamplona.quartz.nip51Lists.bookmarkSet.BookmarkSetEvent import com.vitorpamplona.quartz.nip51Lists.favoriteAlgoFeedsList.FavoriteAlgoFeedsListEvent -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.followSet.FollowSetEvent import com.vitorpamplona.quartz.nip51Lists.geohashList.GeohashListEvent import com.vitorpamplona.quartz.nip51Lists.gitAuthorList.GitAuthorListEvent import com.vitorpamplona.quartz.nip51Lists.gitRepositoryList.GitRepositoryListEvent import com.vitorpamplona.quartz.nip51Lists.goodWikiAuthorList.GoodWikiAuthorListEvent import com.vitorpamplona.quartz.nip51Lists.goodWikiRelayList.GoodWikiRelayListEvent -import com.vitorpamplona.quartz.nip51Lists.hashtagList.InterestListEvent +import com.vitorpamplona.quartz.nip51Lists.interestList.InterestListEvent import com.vitorpamplona.quartz.nip51Lists.interestSet.InterestSetEvent import com.vitorpamplona.quartz.nip51Lists.kindMuteSet.KindMuteSetEvent -import com.vitorpamplona.quartz.nip51Lists.labeledBookmarkList.BookmarkSetEvent import com.vitorpamplona.quartz.nip51Lists.mediaFollowList.MediaFollowListEvent import com.vitorpamplona.quartz.nip51Lists.mediaStarterPack.MediaStarterPackEvent import com.vitorpamplona.quartz.nip51Lists.muteList.MuteListEvent -import com.vitorpamplona.quartz.nip51Lists.peopleList.FollowSetEvent import com.vitorpamplona.quartz.nip51Lists.pictureCurationSet.PictureCurationSetEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.BlockedRelayListEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.BroadcastRelayListEvent @@ -392,6 +391,7 @@ import com.vitorpamplona.quartz.nip51Lists.relayLists.TrustedRelayListEvent import com.vitorpamplona.quartz.nip51Lists.relaySets.RelaySetEvent import com.vitorpamplona.quartz.nip51Lists.releaseArtifactSet.ReleaseArtifactSetEvent import com.vitorpamplona.quartz.nip51Lists.simpleGroupList.SimpleGroupListEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import com.vitorpamplona.quartz.nip51Lists.videoCurationSet.VideoCurationSetEvent import com.vitorpamplona.quartz.nip52Calendar.appt.day.CalendarDateSlotEvent import com.vitorpamplona.quartz.nip52Calendar.appt.time.CalendarTimeSlotEvent @@ -1192,7 +1192,7 @@ private fun RenderNoteRow( } is ZapReceiptEvent -> { - RenderLnZap(baseNote, quotesLeft, backgroundColor, accountViewModel, nav) + RenderZapReceipt(baseNote, quotesLeft, backgroundColor, accountViewModel, nav) } is NutzapEvent -> { @@ -1220,7 +1220,7 @@ private fun RenderNoteRow( } is StarterPackEvent -> { - DisplayFollowList(baseNote, true, accountViewModel, nav) + DisplayStarterPack(baseNote, true, accountViewModel, nav) } is ContactListEvent -> { @@ -1252,7 +1252,7 @@ private fun RenderNoteRow( } is FavoriteRelayListEvent -> { - DisplayRelayFeedsList(baseNote, backgroundColor, accountViewModel, nav) + DisplayFavoriteRelayList(baseNote, backgroundColor, accountViewModel, nav) } is IndexerRelayListEvent -> { @@ -1551,7 +1551,7 @@ private fun RenderNoteRow( } is DvmContentDiscoveryResponseEvent -> { - RenderNIP90ContentDiscoveryResponse( + RenderDvmContentDiscoveryResponse( baseNote, makeItShort, canPreview, @@ -1563,7 +1563,7 @@ private fun RenderNoteRow( } is DvmStatusEvent -> { - RenderNIP90Status( + RenderDvmStatus( baseNote, accountViewModel, nav, @@ -1641,7 +1641,7 @@ private fun RenderNoteRow( } is FileMetadataEvent -> { - FileHeaderDisplay(baseNote, true, ContentScale.FillWidth, accountViewModel) + FileMetadataDisplay(baseNote, true, ContentScale.FillWidth, accountViewModel) } // Covers every NIP-71 video kind (21, 22, 34235, 34236) via the shared interface, @@ -1880,7 +1880,7 @@ private fun RenderNoteRow( } is BookmarkSetEvent -> { - RenderLabeledBookmarkList(baseNote, quotesLeft, backgroundColor, accountViewModel, nav) + RenderBookmarkSet(baseNote, quotesLeft, backgroundColor, accountViewModel, nav) } is ArticleCurationSetEvent -> { @@ -1924,7 +1924,7 @@ private fun RenderNoteRow( } is InterestListEvent -> { - RenderHashtagList(baseNote, backgroundColor, accountViewModel, nav) + RenderInterestList(baseNote, backgroundColor, accountViewModel, nav) } is InterestSetEvent -> { diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteQuickActionMenu.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteQuickActionMenu.kt index a6999b790b..27c3f60fd7 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteQuickActionMenu.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteQuickActionMenu.kt @@ -116,8 +116,8 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.report.ReportNoteDialog import com.vitorpamplona.quartz.experimental.bounties.bountyBaseReward import com.vitorpamplona.quartz.nip28PublicChat.message.ChannelMessageEvent -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent -import com.vitorpamplona.quartz.nip51Lists.peopleList.FollowSetEvent +import com.vitorpamplona.quartz.nip51Lists.followSet.FollowSetEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import kotlinx.coroutines.launch import org.jetbrains.compose.resources.StringResource diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/UpdateReactionTypeDialog.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/UpdateReactionTypeDialog.kt index 5faaa6a2e2..415645df86 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/UpdateReactionTypeDialog.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/UpdateReactionTypeDialog.kt @@ -358,7 +358,7 @@ private fun EmojiSelector( onClick: ((EmojiUrlTag) -> Unit)? = null, ) { LoadAddressableNote( - accountViewModel.account.emoji.getEmojiPackSelectionAddress(), + accountViewModel.account.emoji.getEmojiListAddress(), ) { emptyNote -> emptyNote?.let { usersEmojiList -> val collections by observeNoteEventAndMapNotNull(usersEmojiList, accountViewModel) { event: EmojiListEvent -> diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/UserProfilePicture.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/UserProfilePicture.kt index 753d91f79f..a5af97da5f 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/UserProfilePicture.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/UserProfilePicture.kt @@ -52,7 +52,7 @@ import com.vitorpamplona.amethyst.commons.ui.note.ScoreTag import com.vitorpamplona.amethyst.commons.ui.screen.LocalDisplaySettings import com.vitorpamplona.amethyst.commons.ui.stringRes import com.vitorpamplona.amethyst.commons.ui.theme.ThemeComparisonColumn -import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUserContactCardsScore +import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUserAssertionsScore import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUserInfo import com.vitorpamplona.amethyst.ui.navigation.routes.routeFor import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel @@ -565,7 +565,7 @@ fun ObserveAndRenderUserCards( modifier: Modifier = Modifier, accountViewModel: AccountViewModel, ) { - val score by observeUserContactCardsScore(user, accountViewModel) + val score by observeUserAssertionsScore(user, accountViewModel) score?.let { ScoreTag(it, size, modifier) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/creators/notify/AudienceSheet.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/creators/notify/AudienceSheet.kt index bb78a2b1b1..ea8a60aca9 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/creators/notify/AudienceSheet.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/creators/notify/AudienceSheet.kt @@ -67,7 +67,7 @@ import com.vitorpamplona.amethyst.commons.model.composer.AudienceList import com.vitorpamplona.amethyst.commons.model.composer.AudienceListKind import com.vitorpamplona.amethyst.commons.model.composer.AudienceMember import com.vitorpamplona.amethyst.commons.model.composer.AudienceSelection -import com.vitorpamplona.amethyst.commons.model.nip51Lists.peopleList.PeopleList +import com.vitorpamplona.amethyst.commons.model.nip51Lists.followSets.PeopleList import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.audience_add_anyway import com.vitorpamplona.amethyst.commons.resources.audience_add_people @@ -545,9 +545,9 @@ private fun MemberBadge( */ @Composable fun rememberAudienceLists(accountViewModel: AccountViewModel): List { - val peopleLists by accountViewModel.account.peopleLists.uiListFlow + val peopleLists by accountViewModel.account.followSets.uiListFlow .collectAsStateWithLifecycle() - val followPacks by accountViewModel.account.followLists.uiListFlow + val followPacks by accountViewModel.account.starterPacks.uiListFlow .collectAsStateWithLifecycle() return remember(peopleLists, followPacks) { diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/elements/DropDownMenu.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/elements/DropDownMenu.kt index dabc6e7890..fd09217ed1 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/elements/DropDownMenu.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/elements/DropDownMenu.kt @@ -281,7 +281,7 @@ fun observeBookmarksFollowsAndAccount( accountViewModel.account.bookmarkState.bookmarks, accountViewModel.account.pinState.pinnedEventIdSet, accountViewModel.showSensitiveContent(), - accountViewModel.account.emoji.getEmojiPackSelectionFlow(), + accountViewModel.account.emoji.getEmojiListFlow(), ) { follows, bookmarks, pinnedIds, showSensitiveContent, emojiSelectionState -> val isEmojiPackInMyList = if (noteIdForEmoji != null) { @@ -312,7 +312,7 @@ fun observeBookmarksFollowsAndAccount( isEmojiPackInMyList = noteIdForEmoji?.let { accountViewModel.account.emoji - .getEmojiPackSelection() + .getEmojiList() ?.isTaggedAddressableNote(it) == true } ?: false, ), diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/ActivityCardPreviews.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/ActivityCardPreviews.kt index d98200b394..d63b6a8880 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/ActivityCardPreviews.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/ActivityCardPreviews.kt @@ -103,10 +103,10 @@ private object ActivityCardPreviewData { } } - fun lnZapNote(): Note { + fun zapReceiptNote(): Note { val id = "d".repeat(64) // Receipts are signed by the lightning provider; the preview skips the - // embedded request and feeds the decrypted card to RenderLnZapCard directly. + // embedded request and feeds the decrypted card to RenderZapReceiptCard directly. return Note(id).apply { event = null author = null @@ -171,12 +171,12 @@ fun EmojiReactionActivityCardPreview() { @Preview @Composable -fun LnZapActivityCardPreview() { +fun ZapReceiptActivityCardPreview() { val accountViewModel = mockAccountViewModel() ThemeComparisonColumn { - RenderLnZapCard( - note = ActivityCardPreviewData.lnZapNote(), + RenderZapReceiptCard( + note = ActivityCardPreviewData.zapReceiptNote(), card = ZapAmountCommentNotification( user = LocalCache.getOrCreateUser(ActivityCardPreviewData.senderHex), diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Emoji.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Emoji.kt index ebdf0422df..d65958b79d 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Emoji.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Emoji.kt @@ -181,7 +181,7 @@ private fun EmojiListOptions( emojiPackNote: Note, ) { LoadAddressableNote( - accountViewModel.account.emoji.getEmojiPackSelectionAddress(), + accountViewModel.account.emoji.getEmojiListAddress(), ) { it?.let { usersEmojiList -> val hasAddedThis by observeNoteAndMap(usersEmojiList, accountViewModel) { diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/FileHeader.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/FileHeader.kt index bda74a2880..29017e1a15 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/FileHeader.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/FileHeader.kt @@ -38,7 +38,7 @@ import com.vitorpamplona.quartz.nip31Alts.alt import com.vitorpamplona.quartz.nip94FileMetadata.FileMetadataEvent @Composable -fun FileHeaderDisplay( +fun FileMetadataDisplay( note: Note, roundedCorner: Boolean, contentScale: ContentScale, @@ -53,7 +53,7 @@ fun FileHeaderDisplay( // which viewer happens to render it, so an NSFW-tagged archive stays behind the same gate. SensitivityWarning(note = note, accountViewModel = accountViewModel) { if (content == null) { - FileHeaderAttachmentCard(event, fullUrl, mimeType) + FileMetadataAttachmentCard(event, fullUrl, mimeType) } else { ZoomableContentView( content = content, @@ -70,7 +70,7 @@ fun FileHeaderDisplay( * * Kind 1063 is a *generic* file container — its `m` tag can name any type, so unlike a NIP-71 * video event the kind itself asserts nothing about how to render the payload. A null here means - * the file belongs in [FileHeaderAttachmentCard] rather than being pushed into the video player. + * the file belongs in [FileMetadataAttachmentCard] rather than being pushed into the video player. */ internal fun FileMetadataEvent.toMediaContent( note: Note, @@ -128,7 +128,7 @@ internal fun FileMetadataEvent.toMediaContent( /** The link card a kind-1063 header falls back to when [toMediaContent] returns null. */ @Composable -internal fun FileHeaderAttachmentCard( +internal fun FileMetadataAttachmentCard( event: FileMetadataEvent, url: String, mimeType: String?, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/NIP90ContentDiscoveryResponse.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/NIP90ContentDiscoveryResponse.kt index 2bee2e52d0..8e2aa280a6 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/NIP90ContentDiscoveryResponse.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/NIP90ContentDiscoveryResponse.kt @@ -38,7 +38,7 @@ import com.vitorpamplona.quartz.nip01Core.tags.hashtags.hasHashtags import com.vitorpamplona.quartz.nip90Dvms.contentDiscoveryResponse.DvmContentDiscoveryResponseEvent @Composable -fun RenderNIP90ContentDiscoveryResponse( +fun RenderDvmContentDiscoveryResponse( note: Note, makeItShort: Boolean, canPreview: Boolean, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/NIP90Status.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/NIP90Status.kt index 6b6bfb0303..19c27a2c83 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/NIP90Status.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/NIP90Status.kt @@ -28,7 +28,7 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.quartz.nip90Dvms.status.DvmStatusEvent @Composable -fun RenderNIP90Status( +fun RenderDvmStatus( note: Note, accountViewModel: AccountViewModel, nav: INav, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/PeopleList.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/PeopleList.kt index 64b4fa7b39..1f5a19840b 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/PeopleList.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/PeopleList.kt @@ -56,7 +56,7 @@ import com.vitorpamplona.amethyst.ui.note.UserCompose import com.vitorpamplona.amethyst.ui.note.getGradient import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.quartz.nip01Core.tags.people.taggedUserIds -import com.vitorpamplona.quartz.nip51Lists.peopleList.FollowSetEvent +import com.vitorpamplona.quartz.nip51Lists.followSet.FollowSetEvent import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.persistentListOf diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/ProfileCard.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/ProfileCard.kt index 344fc539a2..c12f7659cb 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/ProfileCard.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/ProfileCard.kt @@ -76,7 +76,7 @@ import com.vitorpamplona.amethyst.commons.ui.theme.bitcoinColor import com.vitorpamplona.amethyst.commons.ui.theme.innerPostModifier import com.vitorpamplona.amethyst.commons.ui.theme.placeholderText import com.vitorpamplona.amethyst.service.relayClient.reqCommand.account.observeAccountIsHiddenUser -import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUserContactCardsFollowerCount +import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUserAssertionsFollowerCount import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUserInfo import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUserIsFollowing import com.vitorpamplona.amethyst.ui.navigation.routes.routeFor @@ -288,7 +288,7 @@ private fun ProfileCardChips( // A self-follow in your own kind:3 is common; "Follows you" on your own card is not a fact. val followsMe by observeUserIsFollowing(author, accountViewModel.account.userProfile(), accountViewModel) val followsYou = followsMe && !accountViewModel.isLoggedUser(author) - val followerCount by observeUserContactCardsFollowerCount(author, accountViewModel) + val followerCount by observeUserAssertionsFollowerCount(author, accountViewModel) // "--" is the placeholder the contact-card observer emits while no trusted // assertion for this user has arrived. Nothing to brag about yet. val followers = followerCount.takeIf { it != "--" } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/RelayList.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/RelayList.kt index ec1f485c88..3a5e7e4ed6 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/RelayList.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/RelayList.kt @@ -241,14 +241,14 @@ fun DisplayTrustedRelayList( } @Composable -fun DisplayRelayFeedsList( +fun DisplayFavoriteRelayList( baseNote: Note, backgroundColor: MutableState, accountViewModel: AccountViewModel, nav: INav, ) { - val relays by accountViewModel.account.relayFeedsListDecryptionCache.observeDecryptedRelayList(baseNote).collectAsStateWithLifecycle( - accountViewModel.account.relayFeedsListDecryptionCache.fastStartValueForRelayList(baseNote), + val relays by accountViewModel.account.favoriteRelayListDecryptionCache.observeDecryptedRelayList(baseNote).collectAsStateWithLifecycle( + accountViewModel.account.favoriteRelayListDecryptionCache.fastStartValueForRelayList(baseNote), ) DisplayRelaySet( diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/FollowList.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/StarterPack.kt similarity index 99% rename from amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/FollowList.kt rename to amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/StarterPack.kt index ac06818f09..88ca1ebd7e 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/FollowList.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/StarterPack.kt @@ -66,13 +66,13 @@ import com.vitorpamplona.amethyst.ui.note.elements.DefaultImageHeaderBackground import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.discover.nip51FollowSets.FollowSetCard import com.vitorpamplona.amethyst.ui.screen.loggedIn.mockAccountViewModel -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.toImmutableList @OptIn(ExperimentalLayoutApi::class) @Composable -fun DisplayFollowList( +fun DisplayStarterPack( baseNote: Note, makeItShort: Boolean, accountViewModel: AccountViewModel, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Wiki.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Wiki.kt index be61fdda0a..1412044f68 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Wiki.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Wiki.kt @@ -60,11 +60,11 @@ fun RenderWikiContent( ) { val noteEvent = note.event as? WikiArticleEvent ?: return - WikiNoteHeader(noteEvent, note, accountViewModel, nav) + WikiArticleHeader(noteEvent, note, accountViewModel, nav) } @Composable -private fun WikiNoteHeader( +private fun WikiArticleHeader( noteEvent: WikiArticleEvent, note: Note, accountViewModel: AccountViewModel, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/ZapEvent.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/ZapEvent.kt index bc6d1bb5f8..26815bdee9 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/ZapEvent.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/ZapEvent.kt @@ -97,7 +97,7 @@ fun RenderZappedPost( } @Composable -fun RenderLnZap( +fun RenderZapReceipt( note: Note, quotesLeft: Int, backgroundColor: MutableState, @@ -108,7 +108,7 @@ fun RenderLnZap( val card by parseAuthorCommentAndAmount(note, accountViewModel) - RenderLnZapCard( + RenderZapReceiptCard( note = note, card = card, recipientKey = zapEvent.zappedAuthor().firstOrNull(), @@ -120,7 +120,7 @@ fun RenderLnZap( } @Composable -fun RenderLnZapCard( +fun RenderZapReceiptCard( note: Note, card: ZapAmountCommentNotification, recipientKey: String?, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/lists/BookmarkLists.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/lists/BookmarkLists.kt index 2a8a1ce57b..24ccbbe3c7 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/lists/BookmarkLists.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/lists/BookmarkLists.kt @@ -38,7 +38,7 @@ import com.vitorpamplona.quartz.nip51Lists.articleCurationSet.ArticleCurationSet import com.vitorpamplona.quartz.nip51Lists.bookmarkList.BookmarkListEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.OldBookmarkListEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.tags.BookmarkIdTag -import com.vitorpamplona.quartz.nip51Lists.labeledBookmarkList.BookmarkSetEvent +import com.vitorpamplona.quartz.nip51Lists.bookmarkSet.BookmarkSetEvent import com.vitorpamplona.quartz.nip51Lists.pictureCurationSet.PictureCurationSetEvent /** NIP-51 kind 10003: the user's bookmarks — notes, articles, hashtags and links. */ @@ -101,7 +101,7 @@ fun RenderOldBookmarkList( /** NIP-51 kind 30003: "user-defined bookmarks categories, for when bookmarks must be in labeled separate groups". */ @Composable -fun RenderLabeledBookmarkList( +fun RenderBookmarkSet( baseNote: Note, quotesLeft: Int, backgroundColor: MutableState, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/lists/TagLists.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/lists/TagLists.kt index b2186cbd21..993591f7cf 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/lists/TagLists.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/lists/TagLists.kt @@ -36,12 +36,12 @@ import com.vitorpamplona.amethyst.commons.ui.stringRes import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.quartz.nip01Core.tags.hashtags.HashtagTag import com.vitorpamplona.quartz.nip51Lists.geohashList.GeohashListEvent -import com.vitorpamplona.quartz.nip51Lists.hashtagList.InterestListEvent +import com.vitorpamplona.quartz.nip51Lists.interestList.InterestListEvent import com.vitorpamplona.quartz.nip51Lists.interestSet.InterestSetEvent /** NIP-51 kind 10015: the hashtags this user follows. */ @Composable -fun RenderHashtagList( +fun RenderInterestList( baseNote: Note, backgroundColor: MutableState, accountViewModel: AccountViewModel, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/AccountSessionManager.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/AccountSessionManager.kt index b8f38aab80..4b6d470a1c 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/AccountSessionManager.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/AccountSessionManager.kt @@ -303,8 +303,8 @@ class AccountSessionManager( accountSettings.backupKeyPackageRelayList?.let { client.publish(it, toPost) } accountSettings.backupSearchRelayList?.let { client.publish(it, toPost) } accountSettings.backupIndexRelayList?.let { client.publish(it, toPost) } - accountSettings.backupRelayFeedsList?.let { client.publish(it, toPost) } - accountSettings.backupChannelList?.let { client.publish(it, toPost) } + accountSettings.backupFavoriteRelayList?.let { client.publish(it, toPost) } + accountSettings.backupPublicChatList?.let { client.publish(it, toPost) } accountSettings.backupCashuWallet?.let { client.publish(it, toPost) } accountSettings.backupNutzapInfo?.let { client.publish(it, toPost) } } @@ -329,8 +329,8 @@ class AccountSessionManager( backupKeyPackageRelayList = bootstrap.keyPackageRelayList, backupSearchRelayList = bootstrap.searchRelayList, backupIndexRelayList = bootstrap.indexerRelayList, - backupChannelList = bootstrap.channelList, - backupRelayFeedsList = bootstrap.relayFeedsList, + backupPublicChatList = bootstrap.publicChatList, + backupFavoriteRelayList = bootstrap.favoriteRelayList, ) } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/TopNavFilterState.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/TopNavFilterState.kt index 8d0618d42d..04e304dcee 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/TopNavFilterState.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/TopNavFilterState.kt @@ -43,9 +43,9 @@ import com.vitorpamplona.amethyst.service.checkNotInMainThread import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl import com.vitorpamplona.quartz.nip01Core.relay.normalizer.RelayUrlNormalizer import com.vitorpamplona.quartz.nip01Core.relay.normalizer.displayUrl -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.followSet.FollowSetEvent import com.vitorpamplona.quartz.nip51Lists.interestSet.InterestSetEvent -import com.vitorpamplona.quartz.nip51Lists.peopleList.FollowSetEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import com.vitorpamplona.quartz.nip72ModCommunities.definition.CommunityDefinitionEvent import com.vitorpamplona.quartz.nip89AppHandlers.definition.AppDefinitionEvent import com.vitorpamplona.quartz.utils.Log @@ -162,14 +162,14 @@ class TopNavFilterState( val livePeopleListsFlow: Flow> = combine( - account.peopleLists.peopleListNotes, - account.followLists.followListNotes, + account.followSets.peopleListNotes, + account.starterPacks.starterPackNotes, ::mergePeopleLists, ).onStart { emit( mergePeopleLists( - account.peopleLists.peopleListNotes.value, - account.followLists.followListNotes.value, + account.followSets.peopleListNotes.value, + account.starterPacks.starterPackNotes.value, ), ) } @@ -247,10 +247,10 @@ class TopNavFilterState( @OptIn(ExperimentalCoroutinesApi::class) val liveInterestFlows: Flow> = combine( - account.hashtagList.flow, + account.interestList.flow, account.geohashList.flow, account.communityList.flowNotes, - account.relayFeedsList.flow, + account.favoriteRelayList.flow, combine( account.favoriteAlgoFeedsList.flowNotes, account.interestSets.listFeedFlow, @@ -261,10 +261,10 @@ class TopNavFilterState( }.onStart { emit( mergeInterests( - account.hashtagList.flow.value, + account.interestList.flow.value, account.geohashList.flow.value, account.communityList.flowNotes.value, - account.relayFeedsList.flow.value, + account.favoriteRelayList.flow.value, account.favoriteAlgoFeedsList.flowNotes.value, account.interestSets.listFeedFlow.value, ), diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountViewModel.kt index 6cd968367e..064b4af887 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountViewModel.kt @@ -202,7 +202,7 @@ import com.vitorpamplona.quartz.nip51Lists.PinListEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.BookmarkListEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.OldBookmarkListEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.tags.AddressBookmark -import com.vitorpamplona.quartz.nip51Lists.hashtagList.InterestListEvent +import com.vitorpamplona.quartz.nip51Lists.interestList.InterestListEvent import com.vitorpamplona.quartz.nip56Reports.ReportType import com.vitorpamplona.quartz.nip57Zaps.ZapReceiptEvent import com.vitorpamplona.quartz.nip57Zaps.ZapRequestEvent @@ -2144,11 +2144,11 @@ class AccountViewModel( fun hide(user: User) = launchSigner { account.hideUser(user.pubkeyHex) } - fun updateContactCardPetName( + fun updateUserAssertionPetName( user: User, petName: String?, summary: String?, - ) = launchSigner { account.updateContactCardPetName(user.pubkeyHex, petName, summary) } + ) = launchSigner { account.updateUserAssertionPetName(user.pubkeyHex, petName, summary) } fun hide(word: String) = launchSigner { account.hideWord(word) } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/DecryptAndIndexProcessor.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/DecryptAndIndexProcessor.kt index 794e1b3027..e09c5e6e4a 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/DecryptAndIndexProcessor.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/DecryptAndIndexProcessor.kt @@ -68,10 +68,10 @@ class EventProcessor( private val draftHandler = DraftEventHandler(account, cache) private val giftWrapHandler = GiftWrapEventHandler(account, cache, this) - private val sealHandler = SealedRumorEventHandler(account, cache, this) + private val sealHandler = SealEventHandler(account, cache, this) - private val zapRequest = LnZapRequestEventHandler(account.privateZapsDecryptionCache) - private val zapEvent = LnZapEventHandler(account.privateZapsDecryptionCache) + private val zapRequest = ZapRequestEventHandler(account.privateZapsDecryptionCache) + private val zapEvent = ZapReceiptEventHandler(account.privateZapsDecryptionCache) private val groupEventHandler = GroupEventHandler(account, cache) @@ -389,7 +389,7 @@ class GiftWrapEventHandler( /** * Shared Marmot Welcome handler used by both [GiftWrapEventHandler] * (in case a Welcome arrives directly inside a kind:1059 with no Seal - * layer) and [SealedRumorEventHandler] (the actual production path — + * layer) and [SealEventHandler] (the actual production path — * Welcomes are wrapped GiftWrap → Seal → Welcome per * [com.vitorpamplona.quartz.marmot.mip02Welcome.WelcomeGiftWrap]). */ @@ -453,7 +453,7 @@ private suspend fun processMarmotWelcomeFlow( } } -class SealedRumorEventHandler( +class SealEventHandler( private val account: Account, private val cache: LocalCache, private val eventProcessor: EventProcessor, @@ -465,14 +465,14 @@ class SealedRumorEventHandler( ) { val rumorId = event.innerEventId if (rumorId == null) { - processNewSealedRumor(event, eventNote, publicNote) + processNewSeal(event, eventNote, publicNote) } else { // Replayed seal: re-link the rumor to its delivering envelope so // broadcast can republish the wrap after a cache rebuild. // publicNote is the outermost event of this unwrap chain — the // kind-1059 wrap normally, the seal itself when it arrived bare. publicNote.event?.let { envelope -> cache.getOrCreateNote(rumorId).recordRumorHost(envelope) } - processExistingSealedRumor(rumorId, publicNote) + processExistingSeal(rumorId, publicNote) } } @@ -488,7 +488,7 @@ class SealedRumorEventHandler( } } - private suspend fun processNewSealedRumor( + private suspend fun processNewSeal( event: SealEvent, eventNote: Note, publicNote: Note, @@ -524,7 +524,7 @@ class SealedRumorEventHandler( eventNote.flowSet?.metadata?.invalidateData() } - private suspend fun processExistingSealedRumor( + private suspend fun processExistingSeal( rumorId: String, publicNote: Note, ) { @@ -536,7 +536,7 @@ class SealedRumorEventHandler( } } -class LnZapRequestEventHandler( +class ZapRequestEventHandler( val decryptionCache: PrivateZapCache, ) : EventHandler { override suspend fun add( @@ -559,7 +559,7 @@ class LnZapRequestEventHandler( } } -class LnZapEventHandler( +class ZapReceiptEventHandler( val decryptionCache: PrivateZapCache, ) : EventHandler { override suspend fun delete( diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/backups/BackupConflictCards.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/backups/BackupConflictCards.kt index bb977a4184..90802e1b17 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/backups/BackupConflictCards.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/backups/BackupConflictCards.kt @@ -65,10 +65,10 @@ import com.vitorpamplona.quartz.nip01Core.diff.ContentChange import com.vitorpamplona.quartz.nip01Core.diff.EventDiff import com.vitorpamplona.quartz.nip01Core.metadata.MetadataDiff import com.vitorpamplona.quartz.nip02FollowList.ContactListDiff -import com.vitorpamplona.quartz.nip28PublicChat.list.ChannelListDiff +import com.vitorpamplona.quartz.nip28PublicChat.list.PublicChatListDiff import com.vitorpamplona.quartz.nip51Lists.favoriteAlgoFeedsList.FavoriteAlgoFeedsListDiff import com.vitorpamplona.quartz.nip51Lists.geohashList.GeohashListDiff -import com.vitorpamplona.quartz.nip51Lists.hashtagList.HashtagListDiff +import com.vitorpamplona.quartz.nip51Lists.interestList.InterestListDiff import com.vitorpamplona.quartz.nip51Lists.muteList.MuteListDiff import com.vitorpamplona.quartz.nip51Lists.relayLists.RelayListDiff import com.vitorpamplona.quartz.nip51Lists.simpleGroupList.SimpleGroupListDiff @@ -130,12 +130,12 @@ private fun headlineOf( is MetadataDiff -> plural(R.plurals.backup_card_profile_lost_fields, counts.removed) is AdvertisedRelayListDiff -> plural(R.plurals.backup_card_nip65_lost, diff.relays.removed.size) is RelayListDiff -> relayListHeadline(conflict.eventType, diff.relays.removed.size) - is ChannelListDiff -> plural(R.plurals.backup_card_leave_chats, diff.channels.removed.size) + is PublicChatListDiff -> plural(R.plurals.backup_card_leave_chats, diff.channels.removed.size) is CommunityListDiff -> plural(R.plurals.backup_card_leave_communities, diff.communities.removed.size) is EphemeralChatListDiff -> plural(R.plurals.backup_card_leave_rooms, diff.rooms.removed.size) is SimpleGroupListDiff -> plural(R.plurals.backup_card_leave_groups, diff.groups.removed.size) is FavoriteAlgoFeedsListDiff -> plural(R.plurals.backup_card_feeds_removed, diff.feeds.removed.size) - is HashtagListDiff -> plural(R.plurals.backup_card_hashtags_unfollowed, diff.hashtags.removed.size) + is InterestListDiff -> plural(R.plurals.backup_card_hashtags_unfollowed, diff.hashtags.removed.size) is GeohashListDiff -> plural(R.plurals.backup_card_places_unfollowed, diff.geohashes.removed.size) is TrustProviderListDiff -> plural(R.plurals.backup_card_trust_services_changed, diff.providers.removed.size + diff.providers.changed.size) is NutzapInfoDiff -> @@ -162,7 +162,7 @@ private fun headlineOf( when { diff is ContactListDiff -> R.plurals.backup_card_and_followed diff is MuteListDiff -> R.plurals.backup_card_and_muted - diff is ChannelListDiff || diff is CommunityListDiff || diff is EphemeralChatListDiff || diff is SimpleGroupListDiff -> R.plurals.backup_card_and_joined + diff is PublicChatListDiff || diff is CommunityListDiff || diff is EphemeralChatListDiff || diff is SimpleGroupListDiff -> R.plurals.backup_card_and_joined conflict.eventType == BackupEventType.BLOCKED_RELAYS -> R.plurals.backup_card_and_blocked else -> R.plurals.backup_card_and_added } @@ -182,12 +182,12 @@ private fun addedToHeadlinedList( is MuteListDiff -> diff.publicMutes.added.size is AdvertisedRelayListDiff -> diff.relays.added.size is RelayListDiff -> if (relayListHasHeadline(type)) diff.relays.added.size else 0 - is ChannelListDiff -> diff.channels.added.size + is PublicChatListDiff -> diff.channels.added.size is CommunityListDiff -> diff.communities.added.size is EphemeralChatListDiff -> diff.rooms.added.size is SimpleGroupListDiff -> diff.groups.added.size is FavoriteAlgoFeedsListDiff -> diff.feeds.added.size - is HashtagListDiff -> diff.hashtags.added.size + is InterestListDiff -> diff.hashtags.added.size is GeohashListDiff -> diff.geohashes.added.size is NutzapInfoDiff -> if (diff.p2pkPubkey == null) diff.mints.added.size else 0 is PaymentTargetsDiff -> diff.targets.added.size diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/backups/BackupConflictListViews.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/backups/BackupConflictListViews.kt index 6587568294..5c67889add 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/backups/BackupConflictListViews.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/backups/BackupConflictListViews.kt @@ -93,7 +93,7 @@ import com.vitorpamplona.quartz.nip01Core.diff.ContentChange import com.vitorpamplona.quartz.nip01Core.diff.ListDiff import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl import com.vitorpamplona.quartz.nip17Dm.settings.DmRelayListEvent -import com.vitorpamplona.quartz.nip28PublicChat.list.ChannelListDiff +import com.vitorpamplona.quartz.nip28PublicChat.list.PublicChatListDiff import com.vitorpamplona.quartz.nip28PublicChat.list.PublicChatListEvent import com.vitorpamplona.quartz.nip28PublicChat.list.channels import com.vitorpamplona.quartz.nip37Drafts.privateOutbox.PrivateOutboxRelayListEvent @@ -102,8 +102,8 @@ import com.vitorpamplona.quartz.nip51Lists.favoriteAlgoFeedsList.FavoriteAlgoFee import com.vitorpamplona.quartz.nip51Lists.favoriteAlgoFeedsList.FavoriteAlgoFeedsListEvent import com.vitorpamplona.quartz.nip51Lists.geohashList.GeohashListDiff import com.vitorpamplona.quartz.nip51Lists.geohashList.GeohashListEvent -import com.vitorpamplona.quartz.nip51Lists.hashtagList.HashtagListDiff -import com.vitorpamplona.quartz.nip51Lists.hashtagList.InterestListEvent +import com.vitorpamplona.quartz.nip51Lists.interestList.InterestListDiff +import com.vitorpamplona.quartz.nip51Lists.interestList.InterestListEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.BlockedRelayListEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.FavoriteRelayListEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.IndexerRelayListEvent @@ -133,11 +133,11 @@ internal fun LazyListScope.listDiffItems( ): Boolean { when (val diff = conflict.diff) { is RelayListDiff -> relayListItems(diff, conflict, nav) - is ChannelListDiff -> publicChatItems(diff, conflict, accountViewModel, nav) + is PublicChatListDiff -> publicChatItems(diff, conflict, accountViewModel, nav) is CommunityListDiff -> communityItems(diff, conflict, accountViewModel, nav) is EphemeralChatListDiff -> ephemeralRoomItems(diff, conflict, nav) is FavoriteAlgoFeedsListDiff -> favoriteFeedItems(diff, conflict, accountViewModel, nav) - is HashtagListDiff -> topicItems(diff.hashtags, (conflict.saved as? InterestListEvent)?.publicHashtags().orEmpty(), diff.privateItems, isPlace = false, nav) + is InterestListDiff -> topicItems(diff.hashtags, (conflict.saved as? InterestListEvent)?.publicHashtags().orEmpty(), diff.privateItems, isPlace = false, nav) is GeohashListDiff -> topicItems(diff.geohashes, (conflict.saved as? GeohashListEvent)?.publicGeohashes().orEmpty(), diff.privateItems, isPlace = true, nav) is TrustProviderListDiff -> trustProviderItems(diff, conflict, accountViewModel, nav) is PaymentTargetsDiff -> paymentTargetItems(diff, conflict) @@ -446,7 +446,7 @@ private fun SpaceTile( } private fun LazyListScope.publicChatItems( - diff: ChannelListDiff, + diff: PublicChatListDiff, conflict: ReplaceableBackupConflict, accountViewModel: AccountViewModel, nav: INav, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/backups/BackupConflictPresentation.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/backups/BackupConflictPresentation.kt index 58195a5d31..9b390254f7 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/backups/BackupConflictPresentation.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/backups/BackupConflictPresentation.kt @@ -41,10 +41,10 @@ import com.vitorpamplona.quartz.nip01Core.metadata.Birthday import com.vitorpamplona.quartz.nip01Core.metadata.MetadataDiff import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl import com.vitorpamplona.quartz.nip02FollowList.ContactListDiff -import com.vitorpamplona.quartz.nip28PublicChat.list.ChannelListDiff +import com.vitorpamplona.quartz.nip28PublicChat.list.PublicChatListDiff import com.vitorpamplona.quartz.nip51Lists.favoriteAlgoFeedsList.FavoriteAlgoFeedsListDiff import com.vitorpamplona.quartz.nip51Lists.geohashList.GeohashListDiff -import com.vitorpamplona.quartz.nip51Lists.hashtagList.HashtagListDiff +import com.vitorpamplona.quartz.nip51Lists.interestList.InterestListDiff import com.vitorpamplona.quartz.nip51Lists.muteList.MuteListDiff import com.vitorpamplona.quartz.nip51Lists.muteList.tags.EventTag import com.vitorpamplona.quartz.nip51Lists.muteList.tags.HashtagTag @@ -104,9 +104,9 @@ fun countsOf(diff: EventDiff): ConflictCounts = is MuteListDiff -> diff.publicMutes.asCounts() + diff.privateItems.asCounts() is AdvertisedRelayListDiff -> diff.relays.asCounts() is RelayListDiff -> diff.relays.asCounts() + diff.privateRelays.asCounts() - is ChannelListDiff -> diff.channels.asCounts() + diff.privateItems.asCounts() + is PublicChatListDiff -> diff.channels.asCounts() + diff.privateItems.asCounts() is CommunityListDiff -> diff.communities.asCounts() + diff.privateItems.asCounts() - is HashtagListDiff -> diff.hashtags.asCounts() + diff.privateItems.asCounts() + is InterestListDiff -> diff.hashtags.asCounts() + diff.privateItems.asCounts() is GeohashListDiff -> diff.geohashes.asCounts() + diff.privateItems.asCounts() is FavoriteAlgoFeedsListDiff -> diff.feeds.asCounts() + diff.privateItems.asCounts() is EphemeralChatListDiff -> diff.rooms.asCounts() + diff.privateItems.asCounts() @@ -330,7 +330,7 @@ fun presentationOf( ) to ContentChange.NONE } is RelayListDiff -> listOf(listGroup(R.string.backup_entry_relay, diff.relays, { ReviewItem.Relay(it) })) to diff.privateRelays - is ChannelListDiff -> + is PublicChatListDiff -> listOf( listGroup( R.string.backup_entry_public_chat, @@ -348,7 +348,7 @@ fun presentationOf( { ReviewItem.Addressable(it.after.address, arrow(it.before.relayHint?.url, it.after.relayHint?.url)) }, ), ) to diff.privateItems - is HashtagListDiff -> listOf(listGroup(R.string.backup_entry_hashtag, diff.hashtags, { ReviewItem.Text("#$it") })) to diff.privateItems + is InterestListDiff -> listOf(listGroup(R.string.backup_entry_hashtag, diff.hashtags, { ReviewItem.Text("#$it") })) to diff.privateItems is GeohashListDiff -> listOf(listGroup(R.string.backup_entry_location, diff.geohashes, { ReviewItem.Text(it) })) to diff.privateItems is FavoriteAlgoFeedsListDiff -> listOf( diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/backups/BackupConflictReviewScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/backups/BackupConflictReviewScreen.kt index 8b5d7b0150..805e43fabc 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/backups/BackupConflictReviewScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/backups/BackupConflictReviewScreen.kt @@ -86,10 +86,10 @@ import com.vitorpamplona.quartz.experimental.ephemChat.list.EphemeralChatListDif import com.vitorpamplona.quartz.nip01Core.diff.ContentChange import com.vitorpamplona.quartz.nip01Core.metadata.MetadataDiff import com.vitorpamplona.quartz.nip02FollowList.ContactListDiff -import com.vitorpamplona.quartz.nip28PublicChat.list.ChannelListDiff +import com.vitorpamplona.quartz.nip28PublicChat.list.PublicChatListDiff import com.vitorpamplona.quartz.nip51Lists.favoriteAlgoFeedsList.FavoriteAlgoFeedsListDiff import com.vitorpamplona.quartz.nip51Lists.geohashList.GeohashListDiff -import com.vitorpamplona.quartz.nip51Lists.hashtagList.HashtagListDiff +import com.vitorpamplona.quartz.nip51Lists.interestList.InterestListDiff import com.vitorpamplona.quartz.nip51Lists.muteList.MuteListDiff import com.vitorpamplona.quartz.nip51Lists.relayLists.RelayListDiff import com.vitorpamplona.quartz.nip51Lists.simpleGroupList.SimpleGroupListDiff @@ -373,11 +373,11 @@ private fun actionLabels(conflict: ReplaceableBackupConflict): Pair stringRes(R.string.backup_conflict_keep_new) to stringRes(R.string.backup_action_restore_relays) - is ChannelListDiff -> rejoinLabels(diff.channels.removed.size) + is PublicChatListDiff -> rejoinLabels(diff.channels.removed.size) is CommunityListDiff -> rejoinLabels(diff.communities.removed.size) is EphemeralChatListDiff -> rejoinLabels(diff.rooms.removed.size) is FavoriteAlgoFeedsListDiff -> stringRes(R.string.backup_conflict_keep_new) to stringRes(R.string.backup_action_restore_feeds) - is HashtagListDiff -> stringRes(R.string.backup_conflict_keep_new) to stringRes(R.string.backup_action_restore_topics) + is InterestListDiff -> stringRes(R.string.backup_conflict_keep_new) to stringRes(R.string.backup_action_restore_topics) // Geohashes are places, not topics: the screen counts "places gone" under "Followed // locations", so the button has to agree with the page it sits on. is GeohashListDiff -> stringRes(R.string.backup_conflict_keep_new) to stringRes(R.string.backup_action_restore_places) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/bookmarkgroups/display/BookmarkGroupScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/bookmarkgroups/display/BookmarkGroupScreen.kt index 15c2317fcd..a951f6deb1 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/bookmarkgroups/display/BookmarkGroupScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/bookmarkgroups/display/BookmarkGroupScreen.kt @@ -101,7 +101,7 @@ fun BookmarkGroupScreen( bookmarkType, broadcastBookmarkGroup = { accountViewModel.launchSigner { - val groupNote = accountViewModel.account.labeledBookmarkLists.getLabeledBookmarkListNote(bookmarkIdentifier) + val groupNote = accountViewModel.account.bookmarkSets.getBookmarkSetNote(bookmarkIdentifier) groupNote?.let { accountViewModel.broadcast(it) } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/bookmarkgroups/display/BookmarkGroupViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/bookmarkgroups/display/BookmarkGroupViewModel.kt index 9cba1b5ad4..c23afd9fb3 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/bookmarkgroups/display/BookmarkGroupViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/bookmarkgroups/display/BookmarkGroupViewModel.kt @@ -40,8 +40,8 @@ class BookmarkGroupViewModel( val bookmarkGroupIdentifier: String, ) : ViewModel() { val selectedBookmarkGroupFlow = - account.labeledBookmarkLists - .getLabeledBookmarkListFlow(bookmarkGroupIdentifier) + account.bookmarkSets + .getBookmarkSetFlow(bookmarkGroupIdentifier) .stateIn(viewModelScope, SharingStarted.WhileSubscribed(2500), null) fun publicPosts() = @@ -69,7 +69,7 @@ class BookmarkGroupViewModel( .stateIn(viewModelScope, SharingStarted.Eagerly, emptyList()) suspend fun deleteBookmarkGroup(groupIdentifier: String) { - account.labeledBookmarkLists.deleteBookmarkList(groupIdentifier, account) + account.bookmarkSets.deleteBookmarkList(groupIdentifier, account) } suspend fun addBookmarkToGroup( @@ -77,7 +77,7 @@ class BookmarkGroupViewModel( bookmark: BookmarkIdTag, isPrivate: Boolean, ) { - account.labeledBookmarkLists.addBookmarkToList( + account.bookmarkSets.addBookmarkToList( bookmark, groupIdentifier, isPrivate, @@ -108,7 +108,7 @@ class BookmarkGroupViewModel( bookmark: BookmarkIdTag, isCurrentlyPrivate: Boolean, ) { - account.labeledBookmarkLists.moveBookmarkInList( + account.bookmarkSets.moveBookmarkInList( bookmark, groupIdentifier, isCurrentlyPrivate, @@ -147,7 +147,7 @@ class BookmarkGroupViewModel( bookmark: BookmarkIdTag, isPrivate: Boolean, ) { - account.labeledBookmarkLists.removeBookmarkFromList( + account.bookmarkSets.removeBookmarkFromList( bookmark, groupIdentifier, isPrivate, @@ -160,7 +160,7 @@ class BookmarkGroupViewModel( deletedEventIds: Set, deletedAddresses: Set
, ) { - account.labeledBookmarkLists.removeDeletedBookmarksFromList( + account.bookmarkSets.removeDeletedBookmarksFromList( groupIdentifier, deletedEventIds, deletedAddresses, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/bookmarkgroups/list/ListOfBookmarkGroupsScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/bookmarkgroups/list/ListOfBookmarkGroupsScreen.kt index 18556e4e82..727d168bf8 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/bookmarkgroups/list/ListOfBookmarkGroupsScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/bookmarkgroups/list/ListOfBookmarkGroupsScreen.kt @@ -40,7 +40,7 @@ import com.vitorpamplona.amethyst.commons.model.nip51Lists.BookmarkType import com.vitorpamplona.amethyst.commons.model.nip51Lists.GitRepositoryListState import com.vitorpamplona.amethyst.commons.model.nip51Lists.OldBookmarkListState import com.vitorpamplona.amethyst.commons.model.nip51Lists.PinListState -import com.vitorpamplona.amethyst.commons.model.nip51Lists.labeledBookmarkLists.LabeledBookmarkList +import com.vitorpamplona.amethyst.commons.model.nip51Lists.bookmarkSets.BookmarkSet import com.vitorpamplona.amethyst.commons.nip51Lists.ui.ListOfBookmarkGroupsFeedView import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.bookmark_lists @@ -64,7 +64,7 @@ fun ListOfBookmarkGroupsScreen( oldBookmarks = accountViewModel.account.oldBookmarkState, pinnedNotes = accountViewModel.account.pinState, repositories = accountViewModel.account.gitRepositoryListState, - listSource = accountViewModel.account.labeledBookmarkLists.listFeedFlow, + listSource = accountViewModel.account.bookmarkSets.listFeedFlow, openDefaultBookmarks = { nav.nav(Route.Bookmarks) }, openOldBookmarks = { nav.nav(Route.OldBookmarks) }, openPinnedNotes = { nav.nav(Route.PinnedNotes) }, @@ -82,7 +82,7 @@ fun ListOfBookmarkGroupsScreen( }, cloneBookmarkGroup = { bookmarkGroup, customName, customDesc -> accountViewModel.launchSigner { - accountViewModel.account.labeledBookmarkLists.cloneBookmarkList( + accountViewModel.account.bookmarkSets.cloneBookmarkList( currentBookmarkList = bookmarkGroup, customCloneName = customName, customCloneDescription = customDesc, @@ -92,7 +92,7 @@ fun ListOfBookmarkGroupsScreen( }, deleteBookmarkGroup = { bookmarkGroup -> accountViewModel.launchSigner { - accountViewModel.account.labeledBookmarkLists.deleteBookmarkList( + accountViewModel.account.bookmarkSets.deleteBookmarkList( bookmarkListIdentifier = bookmarkGroup.identifier, account = accountViewModel.account, ) @@ -109,7 +109,7 @@ fun ListOfBookmarkGroupsFeed( oldBookmarks: OldBookmarkListState, pinnedNotes: PinListState, repositories: GitRepositoryListState, - listSource: StateFlow>, + listSource: StateFlow>, openDefaultBookmarks: () -> Unit, openOldBookmarks: () -> Unit, openPinnedNotes: () -> Unit, @@ -117,10 +117,10 @@ fun ListOfBookmarkGroupsFeed( openPodcasts: () -> Unit, addBookmarkGroup: () -> Unit, openBookmarkGroup: (identifier: String, bookmarkType: BookmarkType) -> Unit, - renameBookmarkGroup: (bookmarkGroup: LabeledBookmarkList) -> Unit, - changeBookmarkGroupDescription: (bookmarkGroup: LabeledBookmarkList) -> Unit, - cloneBookmarkGroup: (bookmarkGroup: LabeledBookmarkList, customName: String?, customDesc: String?) -> Unit, - deleteBookmarkGroup: (bookmarkGroup: LabeledBookmarkList) -> Unit, + renameBookmarkGroup: (bookmarkGroup: BookmarkSet) -> Unit, + changeBookmarkGroupDescription: (bookmarkGroup: BookmarkSet) -> Unit, + cloneBookmarkGroup: (bookmarkGroup: BookmarkSet, customName: String?, customDesc: String?) -> Unit, + deleteBookmarkGroup: (bookmarkGroup: BookmarkSet) -> Unit, accountViewModel: AccountViewModel, nav: INav, ) { diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/bookmarkgroups/list/metadata/BookmarkGroupMetadataViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/bookmarkgroups/list/metadata/BookmarkGroupMetadataViewModel.kt index d8e41c8398..1f2f4bc31a 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/bookmarkgroups/list/metadata/BookmarkGroupMetadataViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/bookmarkgroups/list/metadata/BookmarkGroupMetadataViewModel.kt @@ -31,7 +31,7 @@ import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.vitorpamplona.amethyst.Amethyst import com.vitorpamplona.amethyst.commons.model.mediaServers.ServerType -import com.vitorpamplona.amethyst.commons.model.nip51Lists.labeledBookmarkLists.LabeledBookmarkList +import com.vitorpamplona.amethyst.commons.model.nip51Lists.bookmarkSets.BookmarkSet import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.avif_metadata_strip_failed import com.vitorpamplona.amethyst.commons.resources.failed_to_upload_media_no_details @@ -59,7 +59,7 @@ class BookmarkGroupMetadataViewModel : ViewModel() { private lateinit var accountViewModel: AccountViewModel private lateinit var account: Account - var bookmarkGroup by mutableStateOf(null) + var bookmarkGroup by mutableStateOf(null) val isNewList by derivedStateOf { bookmarkGroup == null } val name = mutableStateOf(TextFieldValue()) @@ -83,7 +83,7 @@ class BookmarkGroupMetadataViewModel : ViewModel() { } fun load(dTag: String) { - bookmarkGroup = account.labeledBookmarkLists.getBookmarkList(dTag) + bookmarkGroup = account.bookmarkSets.getBookmarkList(dTag) name.value = TextFieldValue(bookmarkGroup?.title ?: "") picture.value = TextFieldValue(bookmarkGroup?.image ?: "") description.value = TextFieldValue(bookmarkGroup?.description ?: "") @@ -95,14 +95,14 @@ class BookmarkGroupMetadataViewModel : ViewModel() { accountViewModel.launchSigner { val bookmarkGroup = bookmarkGroup if (bookmarkGroup == null) { - accountViewModel.account.labeledBookmarkLists.addLabeledBookmarkList( + accountViewModel.account.bookmarkSets.addBookmarkSet( listName = name.value.text, listDescription = description.value.text, listImage = picture.value.text, account = accountViewModel.account, ) } else { - accountViewModel.account.labeledBookmarkLists.updateMetadata( + accountViewModel.account.bookmarkSets.updateMetadata( listName = name.value.text, listDescription = description.value.text, listImage = picture.value.text, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/bookmarkgroups/membershipManagement/ArticleBookmarkListManagementScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/bookmarkgroups/membershipManagement/ArticleBookmarkListManagementScreen.kt index d1e3f9749c..c562d73658 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/bookmarkgroups/membershipManagement/ArticleBookmarkListManagementScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/bookmarkgroups/membershipManagement/ArticleBookmarkListManagementScreen.kt @@ -37,7 +37,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.vitorpamplona.amethyst.commons.model.AddressableNote import com.vitorpamplona.amethyst.commons.model.navigation.Route import com.vitorpamplona.amethyst.commons.model.nip51Lists.BookmarkType -import com.vitorpamplona.amethyst.commons.model.nip51Lists.labeledBookmarkLists.LabeledBookmarkList +import com.vitorpamplona.amethyst.commons.model.nip51Lists.bookmarkSets.BookmarkSet import com.vitorpamplona.amethyst.commons.nip51Lists.ui.BookmarkGroupManagementItem import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.article_bookmark_management_title @@ -109,7 +109,7 @@ private fun ListManagementViewBody( accountViewModel: AccountViewModel, nav: INav, ) { - val bookmarkGroups by accountViewModel.account.labeledBookmarkLists.listFeedFlow + val bookmarkGroups by accountViewModel.account.bookmarkSets.listFeedFlow .collectAsStateWithLifecycle() val defaultBookmarks by accountViewModel.account.bookmarkState.bookmarks @@ -146,7 +146,7 @@ private fun ListManagementViewBody( ) } - itemsIndexed(items = bookmarkGroups, key = { _: Int, item: LabeledBookmarkList -> item.identifier }) { _, bookmarkList -> + itemsIndexed(items = bookmarkGroups, key = { _: Int, item: BookmarkSet -> item.identifier }) { _, bookmarkList -> val maybePublicBookmark = bookmarkList.publicArticleBookmarks.firstOrNull { it.address == note.address } val maybePrivateBookmark = bookmarkList.privateArticleBookmarks.firstOrNull { it.address == note.address } BookmarkGroupManagementItem( @@ -159,7 +159,7 @@ private fun ListManagementViewBody( onClick = { nav.nav(Route.BookmarkGroupView(bookmarkList.identifier, BookmarkType.ArticleBookmark)) }, onAddBookmarkToGroup = { shouldBePrivate -> accountViewModel.launchSigner { - accountViewModel.account.labeledBookmarkLists.addBookmarkToList( + accountViewModel.account.bookmarkSets.addBookmarkToList( bookmark = AddressBookmark(address = note.address, relayHint = note.relayHintUrl()), bookmarkListIdentifier = bookmarkList.identifier, isBookmarkPrivate = shouldBePrivate, @@ -169,7 +169,7 @@ private fun ListManagementViewBody( }, onRemoveBookmarkFromGroup = { accountViewModel.launchSigner { - accountViewModel.account.labeledBookmarkLists.removeBookmarkFromList( + accountViewModel.account.bookmarkSets.removeBookmarkFromList( bookmark = AddressBookmark(address = note.address), bookmarkListIdentifier = bookmarkList.identifier, isBookmarkPrivate = maybePrivateBookmark != null, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/bookmarkgroups/membershipManagement/PostBookmarkListManagementScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/bookmarkgroups/membershipManagement/PostBookmarkListManagementScreen.kt index 12e2a0860a..49564f47a5 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/bookmarkgroups/membershipManagement/PostBookmarkListManagementScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/bookmarkgroups/membershipManagement/PostBookmarkListManagementScreen.kt @@ -37,7 +37,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.vitorpamplona.amethyst.commons.model.Note import com.vitorpamplona.amethyst.commons.model.navigation.Route import com.vitorpamplona.amethyst.commons.model.nip51Lists.BookmarkType -import com.vitorpamplona.amethyst.commons.model.nip51Lists.labeledBookmarkLists.LabeledBookmarkList +import com.vitorpamplona.amethyst.commons.model.nip51Lists.bookmarkSets.BookmarkSet import com.vitorpamplona.amethyst.commons.nip51Lists.ui.BookmarkGroupManagementItem import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.bookmarks_title @@ -108,7 +108,7 @@ private fun ListManagementViewBody( accountViewModel: AccountViewModel, nav: INav, ) { - val bookmarkGroups by accountViewModel.account.labeledBookmarkLists.listFeedFlow + val bookmarkGroups by accountViewModel.account.bookmarkSets.listFeedFlow .collectAsStateWithLifecycle() val defaultBookmarks by accountViewModel.account.bookmarkState.bookmarks @@ -145,7 +145,7 @@ private fun ListManagementViewBody( ) } - itemsIndexed(items = bookmarkGroups, key = { _: Int, item: LabeledBookmarkList -> item.identifier }) { _, bookmarkList -> + itemsIndexed(items = bookmarkGroups, key = { _: Int, item: BookmarkSet -> item.identifier }) { _, bookmarkList -> val maybePublicBookmark = bookmarkList.publicPostBookmarks.firstOrNull { it.eventId == note.idHex } val maybePrivateBookmark = bookmarkList.privatePostBookmarks.firstOrNull { it.eventId == note.idHex } BookmarkGroupManagementItem( @@ -158,7 +158,7 @@ private fun ListManagementViewBody( onClick = { nav.nav(Route.BookmarkGroupView(bookmarkList.identifier, BookmarkType.PostBookmark)) }, onAddBookmarkToGroup = { shouldBePrivate -> accountViewModel.launchSigner { - accountViewModel.account.labeledBookmarkLists.addBookmarkToList( + accountViewModel.account.bookmarkSets.addBookmarkToList( bookmark = EventBookmark(eventId = note.idHex, relay = note.relayHintUrl(), author = note.author?.pubkeyHex), bookmarkListIdentifier = bookmarkList.identifier, isBookmarkPrivate = shouldBePrivate, @@ -168,7 +168,7 @@ private fun ListManagementViewBody( }, onRemoveBookmarkFromGroup = { accountViewModel.launchSigner { - accountViewModel.account.labeledBookmarkLists.removeBookmarkFromList( + accountViewModel.account.bookmarkSets.removeBookmarkFromList( bookmark = EventBookmark(eventId = note.idHex), bookmarkListIdentifier = bookmarkList.identifier, isBookmarkPrivate = maybePrivateBookmark != null, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupDiscoveryScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupDiscoveryScreen.kt index afdf3562b4..93ea1bb03c 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupDiscoveryScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupDiscoveryScreen.kt @@ -250,7 +250,7 @@ private fun WatchAccountForRelayGroupDiscovery( .collectAsStateWithLifecycle() val joinedServers by accountViewModel.account.relayGroupList.liveRelayGroupServers .collectAsStateWithLifecycle() - val favoriteRelays by accountViewModel.account.relayFeedsList.flow + val favoriteRelays by accountViewModel.account.favoriteRelayList.flow .collectAsStateWithLifecycle() // Discovery only shows groups whose 39000 is signed by the host relay's own key (NIP-29's @@ -349,7 +349,7 @@ private fun RelayRailHeader( val info = loadRelayInfo(relay) val host = relay.displayUrl() val name = info.value.name?.takeIf { it.isNotBlank() } ?: host - val favoriteRelays by accountViewModel.account.relayFeedsList.flow + val favoriteRelays by accountViewModel.account.favoriteRelayList.flow .collectAsStateWithLifecycle() val isFavorite = relay in favoriteRelays diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupMembersScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupMembersScreen.kt index 9d9b4b5e5c..d94934ee10 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupMembersScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupMembersScreen.kt @@ -408,7 +408,7 @@ private fun RelayGroupMemberRow( ) } DropdownMenu(expanded = menuOpen, onDismissRequest = { menuOpen = false }) { - val declaredRoles = channel.supportedRoles + val declaredRoles = channel.groupRoles if (declaredRoles.isNotEmpty()) { // The relay declares its own role set (kind 39003) — offer exactly those // instead of the built-in admin/moderator pair. Roles are privilege grants, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/datasource/RelayGroupsDiscoverySubAssembler.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/datasource/RelayGroupsDiscoverySubAssembler.kt index 8d0897ae01..23715d84f2 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/datasource/RelayGroupsDiscoverySubAssembler.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/datasource/RelayGroupsDiscoverySubAssembler.kt @@ -100,7 +100,7 @@ class RelayGroupsDiscoverySubAssembler( account.relayGroupList.liveRelayGroupServers.value.forEach { server -> RelayUrlNormalizer.normalizeOrNull(server)?.let(::add) } - addAll(account.relayFeedsList.flow.value) + addAll(account.favoriteRelayList.flow.value) } override fun user(key: RelayGroupsDiscoveryQueryState) = key.account.userProfile() @@ -156,7 +156,7 @@ class RelayGroupsDiscoverySubAssembler( } }, key.account.scope.launch(Dispatchers.IO) { - key.account.relayFeedsList.flow.sample(500).collectLatest { + key.account.favoriteRelayList.flow.sample(500).collectLatest { invalidateFilters() } }, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/discover/ChannelCardCompose.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/discover/ChannelCardCompose.kt index b6eb04d860..f4e4212c37 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/discover/ChannelCardCompose.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/discover/ChannelCardCompose.kt @@ -45,7 +45,7 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.discover.nip90DVMs.RenderCo import com.vitorpamplona.amethyst.ui.screen.loggedIn.discover.nip99Classifieds.RenderClassifiedsThumb import com.vitorpamplona.quartz.nip23LongContent.LongFormContentEvent import com.vitorpamplona.quartz.nip28PublicChat.admin.ChannelCreateEvent -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import com.vitorpamplona.quartz.nip53LiveActivities.meetingSpaces.MeetingRoomEvent import com.vitorpamplona.quartz.nip53LiveActivities.meetingSpaces.MeetingSpaceEvent import com.vitorpamplona.quartz.nip53LiveActivities.streaming.LiveActivitiesEvent diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/discover/DiscoverScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/discover/DiscoverScreen.kt index 5d28a436a8..f85d225362 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/discover/DiscoverScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/discover/DiscoverScreen.kt @@ -88,7 +88,7 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.discover.datasource.Discove import com.vitorpamplona.amethyst.ui.screen.loggedIn.home.TabItem import com.vitorpamplona.quartz.nip23LongContent.LongFormContentEvent import com.vitorpamplona.quartz.nip28PublicChat.admin.ChannelCreateEvent -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import com.vitorpamplona.quartz.nip53LiveActivities.streaming.LiveActivitiesEvent import com.vitorpamplona.quartz.nip72ModCommunities.definition.CommunityDefinitionEvent import com.vitorpamplona.quartz.nip89AppHandlers.definition.AppDefinitionEvent diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/discover/nip51FollowSets/DiscoverFollowSetsFeedFilter.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/discover/nip51FollowSets/DiscoverFollowSetsFeedFilter.kt index 2e09975f62..1e0fdcad4d 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/discover/nip51FollowSets/DiscoverFollowSetsFeedFilter.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/discover/nip51FollowSets/DiscoverFollowSetsFeedFilter.kt @@ -28,7 +28,7 @@ import com.vitorpamplona.amethyst.commons.model.topNavFeeds.TopFilter import com.vitorpamplona.amethyst.model.Account import com.vitorpamplona.amethyst.ui.dal.FilterByListParams import com.vitorpamplona.amethyst.ui.dal.sortedByDefaultFeedOrder -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent open class DiscoverFollowSetsFeedFilter( val account: Account, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/discover/nip51FollowSets/FollowSetCard.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/discover/nip51FollowSets/FollowSetCard.kt index d7399581f6..3e249d4a59 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/discover/nip51FollowSets/FollowSetCard.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/discover/nip51FollowSets/FollowSetCard.kt @@ -63,7 +63,7 @@ import com.vitorpamplona.amethyst.ui.note.elements.DefaultImageBannerBackground import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.mockAccountViewModel import com.vitorpamplona.quartz.nip01Core.core.HexKey -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.toImmutableList diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/dvms/DvmContentDiscoveryScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/dvms/DvmContentDiscoveryScreen.kt index ef283a4950..a0f559056c 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/dvms/DvmContentDiscoveryScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/dvms/DvmContentDiscoveryScreen.kt @@ -87,7 +87,7 @@ import com.vitorpamplona.amethyst.ui.screen.RenderFeedState import com.vitorpamplona.amethyst.ui.screen.SaveableFeedState import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.discover.nip90DVMs.DVMCard -import com.vitorpamplona.amethyst.ui.screen.loggedIn.dvms.dal.NIP90ContentDiscoveryFeedViewModel +import com.vitorpamplona.amethyst.ui.screen.loggedIn.dvms.dal.DvmContentDiscoveryFeedViewModel import com.vitorpamplona.quartz.lightning.LnInvoiceUtil import com.vitorpamplona.quartz.nip01Core.relay.filters.Filter import com.vitorpamplona.quartz.nip89AppHandlers.definition.AppDefinitionEvent @@ -263,22 +263,22 @@ fun PrepareViewContentDiscoveryModels( accountViewModel: AccountViewModel, nav: INav, ) { - val resultFeedViewModel: NIP90ContentDiscoveryFeedViewModel = + val resultFeedViewModel: DvmContentDiscoveryFeedViewModel = viewModel( key = "NostrNIP90ContentDiscoveryFeedViewModel${dvm.pubkeyHex}$dvmRequestId", - factory = NIP90ContentDiscoveryFeedViewModel.Factory(accountViewModel.account, dvmKey = dvm.pubkeyHex, requestId = dvmRequestId), + factory = DvmContentDiscoveryFeedViewModel.Factory(accountViewModel.account, dvmKey = dvm.pubkeyHex, requestId = dvmRequestId), ) LaunchedEffect(key1 = dvmRequestId, latestResponse.id) { resultFeedViewModel.invalidateData() } - RenderNostrNIP90ContentDiscoveryScreen(resultFeedViewModel, onRefresh, accountViewModel, nav) + RenderNostrDvmContentDiscoveryScreen(resultFeedViewModel, onRefresh, accountViewModel, nav) } @Composable -fun RenderNostrNIP90ContentDiscoveryScreen( - resultFeedViewModel: NIP90ContentDiscoveryFeedViewModel, +fun RenderNostrDvmContentDiscoveryScreen( + resultFeedViewModel: DvmContentDiscoveryFeedViewModel, onRefresh: () -> Unit, accountViewModel: AccountViewModel, nav: INav, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/dvms/dal/NIP90ContentDiscoveryFeedViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/dvms/dal/DvmContentDiscoveryFeedViewModel.kt similarity index 89% rename from amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/dvms/dal/NIP90ContentDiscoveryFeedViewModel.kt rename to amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/dvms/dal/DvmContentDiscoveryFeedViewModel.kt index 5bf18acf92..6e16027d13 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/dvms/dal/NIP90ContentDiscoveryFeedViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/dvms/dal/DvmContentDiscoveryFeedViewModel.kt @@ -27,17 +27,17 @@ import com.vitorpamplona.amethyst.model.Account import com.vitorpamplona.amethyst.ui.screen.AndroidFeedViewModel @Stable -class NIP90ContentDiscoveryFeedViewModel( +class DvmContentDiscoveryFeedViewModel( val account: Account, dvmKey: String, requestId: String, -) : AndroidFeedViewModel(NIP90ContentDiscoveryResponseFilter(account, dvmKey, requestId)) { +) : AndroidFeedViewModel(DvmContentDiscoveryResponseFilter(account, dvmKey, requestId)) { class Factory( val account: Account, val dvmKey: String, val requestId: String, ) : ViewModelProvider.Factory { @Suppress("UNCHECKED_CAST") - override fun create(modelClass: Class): T = NIP90ContentDiscoveryFeedViewModel(account, dvmKey, requestId) as T + override fun create(modelClass: Class): T = DvmContentDiscoveryFeedViewModel(account, dvmKey, requestId) as T } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/dvms/dal/NIP90ContentDiscoveryResponseFilter.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/dvms/dal/DvmContentDiscoveryResponseFilter.kt similarity index 98% rename from amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/dvms/dal/NIP90ContentDiscoveryResponseFilter.kt rename to amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/dvms/dal/DvmContentDiscoveryResponseFilter.kt index acb70c2ab0..b9c8653a49 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/dvms/dal/NIP90ContentDiscoveryResponseFilter.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/dvms/dal/DvmContentDiscoveryResponseFilter.kt @@ -29,7 +29,7 @@ import com.vitorpamplona.amethyst.ui.dal.FilterByListParams import com.vitorpamplona.quartz.nip01Core.tags.events.isTaggedEvent import com.vitorpamplona.quartz.nip90Dvms.contentDiscoveryResponse.DvmContentDiscoveryResponseEvent -open class NIP90ContentDiscoveryResponseFilter( +open class DvmContentDiscoveryResponseFilter( val account: Account, val dvmkey: String, val request: String, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/emojipacks/list/ListOfEmojiPacksScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/emojipacks/list/ListOfEmojiPacksScreen.kt index 3d1af6ad19..e385a772aa 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/emojipacks/list/ListOfEmojiPacksScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/emojipacks/list/ListOfEmojiPacksScreen.kt @@ -315,7 +315,7 @@ private fun EmojiListToggleRow( LoadAddressableNote(packAddress) { it?.let { packNote -> LoadAddressableNote( - accountViewModel.account.emoji.getEmojiPackSelectionAddress(), + accountViewModel.account.emoji.getEmojiListAddress(), ) { selectionNote -> selectionNote?.let { usersEmojiList -> val hasAddedThis by observeNoteAndMap(usersEmojiList, accountViewModel) { diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/emojipacks/membershipManagement/EmojiPackSelectionScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/emojipacks/membershipManagement/EmojiPackSelectionScreen.kt index 798e89e207..e3774aa912 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/emojipacks/membershipManagement/EmojiPackSelectionScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/emojipacks/membershipManagement/EmojiPackSelectionScreen.kt @@ -121,7 +121,7 @@ private fun EmojiPackSelectionBody( ) { item { LoadAddressableNote( - address = accountViewModel.account.emoji.getEmojiPackSelectionAddress(), + address = accountViewModel.account.emoji.getEmojiListAddress(), ) { selectionNote -> selectionNote?.let { val hasAddedThis by observeNoteAndMap(it, accountViewModel) { currentNote -> diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/emojipacks/membershipManagement/MyEmojiListScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/emojipacks/membershipManagement/MyEmojiListScreen.kt index 6226d1a680..b23457dc69 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/emojipacks/membershipManagement/MyEmojiListScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/emojipacks/membershipManagement/MyEmojiListScreen.kt @@ -79,7 +79,7 @@ fun MyEmojiListScreen( nav: INav, ) { LoadAddressableNote( - address = accountViewModel.account.emoji.getEmojiPackSelectionAddress(), + address = accountViewModel.account.emoji.getEmojiListAddress(), ) { selectionNote -> selectionNote?.let { MyEmojiListView( diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/followPacks/feed/FollowPackFeedScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/followPacks/feed/FollowPackFeedScreen.kt index e72a91d271..cad3be3193 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/followPacks/feed/FollowPackFeedScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/followPacks/feed/FollowPackFeedScreen.kt @@ -85,7 +85,7 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.followPacks.feed.dal.Follow import com.vitorpamplona.amethyst.ui.screen.loggedIn.followPacks.feed.dal.FollowPackMembersUserFeedViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.followPacks.feed.datasource.FollowPackFeedFilterAssemblerSubscription import com.vitorpamplona.quartz.nip01Core.core.Address -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import kotlinx.coroutines.launch @OptIn(ExperimentalMaterial3Api::class) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/followPacks/feed/dal/FollowPackFeedConversationsFeedFilter.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/followPacks/feed/dal/FollowPackFeedConversationsFeedFilter.kt index 663afb6994..2a56243e86 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/followPacks/feed/dal/FollowPackFeedConversationsFeedFilter.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/followPacks/feed/dal/FollowPackFeedConversationsFeedFilter.kt @@ -37,7 +37,7 @@ import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl import com.vitorpamplona.quartz.nip10Notes.TextNoteEvent import com.vitorpamplona.quartz.nip22Comments.CommentEvent import com.vitorpamplona.quartz.nip28PublicChat.message.ChannelMessageEvent -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import com.vitorpamplona.quartz.nip53LiveActivities.chat.LiveActivitiesChatMessageEvent import com.vitorpamplona.quartz.nipA0VoiceMessages.VoiceReplyEvent import com.vitorpamplona.quartz.nipA4PublicMessages.PublicMessageEvent diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/followPacks/feed/dal/FollowPackFeedNewThreadFeedFilter.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/followPacks/feed/dal/FollowPackFeedNewThreadFeedFilter.kt index c89f21f3d7..26a3f6bd6f 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/followPacks/feed/dal/FollowPackFeedNewThreadFeedFilter.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/followPacks/feed/dal/FollowPackFeedNewThreadFeedFilter.kt @@ -46,7 +46,7 @@ import com.vitorpamplona.quartz.nip18Reposts.GenericRepostEvent import com.vitorpamplona.quartz.nip18Reposts.RepostEvent import com.vitorpamplona.quartz.nip22Comments.CommentEvent import com.vitorpamplona.quartz.nip23LongContent.LongFormContentEvent -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import com.vitorpamplona.quartz.nip54Wiki.WikiArticleEvent import com.vitorpamplona.quartz.nip84Highlights.HighlightEvent import com.vitorpamplona.quartz.nip99Classifieds.ClassifiedsEvent diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/followPacks/feed/dal/FollowPackMembersFeedFilter.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/followPacks/feed/dal/FollowPackMembersFeedFilter.kt index a081c0031b..0e6b1ee160 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/followPacks/feed/dal/FollowPackMembersFeedFilter.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/followPacks/feed/dal/FollowPackMembersFeedFilter.kt @@ -25,7 +25,7 @@ import com.vitorpamplona.amethyst.commons.model.AddressableNote import com.vitorpamplona.amethyst.commons.model.User import com.vitorpamplona.amethyst.commons.model.cache.LocalCache.checkGetOrCreateUser import com.vitorpamplona.amethyst.model.Account -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent class FollowPackMembersFeedFilter( val followPackNote: AddressableNote, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/followPacks/feed/datasource/FollowPackFeedFilterSubAssembler.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/followPacks/feed/datasource/FollowPackFeedFilterSubAssembler.kt index 7c7b968467..13c6fe051f 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/followPacks/feed/datasource/FollowPackFeedFilterSubAssembler.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/followPacks/feed/datasource/FollowPackFeedFilterSubAssembler.kt @@ -27,7 +27,7 @@ import com.vitorpamplona.amethyst.commons.relayClient.home.nip65Follows.filterHo import com.vitorpamplona.amethyst.commons.relays.SincePerRelayMap import com.vitorpamplona.quartz.nip01Core.relay.client.INostrClient import com.vitorpamplona.quartz.nip01Core.relay.client.pool.RelayBasedFilter -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent class FollowPackFeedFilterSubAssembler( client: INostrClient, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/followPacks/list/FollowPacksFeedLoaded.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/followPacks/list/FollowPacksFeedLoaded.kt index 4ff1d00053..5937c2290a 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/followPacks/list/FollowPacksFeedLoaded.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/followPacks/list/FollowPacksFeedLoaded.kt @@ -38,7 +38,7 @@ import com.vitorpamplona.amethyst.commons.ui.theme.DividerThickness import com.vitorpamplona.amethyst.commons.ui.theme.FeedPadding import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.discover.ChannelCardCompose -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent @OptIn(ExperimentalFoundationApi::class) @Composable diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/followPacks/list/FollowPacksTopBar.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/followPacks/list/FollowPacksTopBar.kt index 1c67d0241b..644b0e02b0 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/followPacks/list/FollowPacksTopBar.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/followPacks/list/FollowPacksTopBar.kt @@ -36,7 +36,7 @@ import com.vitorpamplona.amethyst.ui.navigation.topbars.UserDrawerSearchTopBar import com.vitorpamplona.amethyst.ui.screen.FeedDefinition import com.vitorpamplona.amethyst.ui.screen.TopNavFilterState import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent @Composable fun FollowPacksTopBar( diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/display/lists/PeopleListViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/display/lists/PeopleListViewModel.kt index 8733e7a42f..dcc16a37a9 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/display/lists/PeopleListViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/display/lists/PeopleListViewModel.kt @@ -31,7 +31,7 @@ import com.vitorpamplona.amethyst.commons.model.User import com.vitorpamplona.amethyst.model.Account import com.vitorpamplona.amethyst.ui.note.creators.userSuggestions.UserSuggestionState import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel -import com.vitorpamplona.quartz.nip51Lists.peopleList.FollowSetEvent +import com.vitorpamplona.quartz.nip51Lists.followSet.FollowSetEvent import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.flow.Flow @@ -57,7 +57,7 @@ class PeopleListViewModel : ViewModel() { selectedDTag .transformLatest { emitAll( - account.peopleLists.selectListFlow(it).flowOn(Dispatchers.IO), + account.followSets.selectListFlow(it).flowOn(Dispatchers.IO), ) }.flowOn(Dispatchers.IO) .stateIn(viewModelScope, SharingStarted.WhileSubscribed(5000), null) @@ -79,23 +79,23 @@ class PeopleListViewModel : ViewModel() { } suspend fun deleteFollowSet() { - account.peopleLists.deleteFollowSet(selectedDTag.value, account) + account.followSets.deleteFollowSet(selectedDTag.value, account) } - fun loadNote(): AddressableNote? = account.peopleLists.getPeopleListNote(selectedDTag.value) + fun loadNote(): AddressableNote? = account.followSets.getPeopleListNote(selectedDTag.value) suspend fun removeUserFromSet( user: User, isPrivate: Boolean, ) { - account.peopleLists.removeUserFromSet(user, isPrivate, selectedDTag.value, account) + account.followSets.removeUserFromSet(user, isPrivate, selectedDTag.value, account) } suspend fun addUserToSet( user: User, isPrivate: Boolean, ) { - account.peopleLists.addUserToSet(user, selectedDTag.value, isPrivate, account) + account.followSets.addUserToSet(user, selectedDTag.value, isPrivate, account) } fun hasUserFlow( diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/display/packs/FollowPackViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/display/packs/FollowPackViewModel.kt index f54fa456ca..002eb5f4a6 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/display/packs/FollowPackViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/display/packs/FollowPackViewModel.kt @@ -31,7 +31,7 @@ import com.vitorpamplona.amethyst.commons.model.User import com.vitorpamplona.amethyst.model.Account import com.vitorpamplona.amethyst.ui.note.creators.userSuggestions.UserSuggestionState import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.flow.Flow @@ -57,7 +57,7 @@ class FollowPackViewModel : ViewModel() { selectedDTag .transformLatest { emitAll( - account.followLists.selectListFlow(it).flowOn(Dispatchers.IO), + account.starterPacks.selectListFlow(it).flowOn(Dispatchers.IO), ) }.flowOn(Dispatchers.IO) .stateIn(viewModelScope, SharingStarted.WhileSubscribed(5000), null) @@ -79,17 +79,17 @@ class FollowPackViewModel : ViewModel() { } suspend fun deleteFollowSet() { - account.followLists.deleteFollowSet(selectedDTag.value, account) + account.starterPacks.deleteFollowSet(selectedDTag.value, account) } - fun loadNote(): AddressableNote? = account.followLists.getPeopleListNote(selectedDTag.value) + fun loadNote(): AddressableNote? = account.starterPacks.getPeopleListNote(selectedDTag.value) suspend fun removeUserFromSet(user: User) { - account.followLists.removeUserFromSet(user, selectedDTag.value, account) + account.starterPacks.removeUserFromSet(user, selectedDTag.value, account) } suspend fun addUserToSet(user: User) { - account.followLists.addUserToSet(user, selectedDTag.value, account) + account.starterPacks.addUserToSet(user, selectedDTag.value, account) } fun hasUserFlow(user: User): Flow = diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/list/FollowPackViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/list/FollowPackViewModel.kt index ad08cf8121..a2bdd2eb2d 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/list/FollowPackViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/list/FollowPackViewModel.kt @@ -22,7 +22,7 @@ package com.vitorpamplona.amethyst.ui.screen.loggedIn.lists.list import androidx.compose.runtime.Stable import androidx.lifecycle.ViewModel -import com.vitorpamplona.amethyst.commons.model.nip51Lists.peopleList.PeopleList +import com.vitorpamplona.amethyst.commons.model.nip51Lists.followSets.PeopleList import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel @Stable @@ -33,7 +33,7 @@ class FollowPackViewModel : ViewModel() { this.accountViewModel = accountViewModel } - fun listFlow() = accountViewModel.account.followLists.uiListFlow + fun listFlow() = accountViewModel.account.starterPacks.uiListFlow fun cloneItem( followSet: PeopleList, @@ -41,7 +41,7 @@ class FollowPackViewModel : ViewModel() { customDescription: String?, ) { accountViewModel.launchSigner { - accountViewModel.account.followLists.cloneFollowSet( + accountViewModel.account.starterPacks.cloneFollowSet( currentFollowPack = followSet, customCloneName = customName, customCloneDescription = customDescription, @@ -52,7 +52,7 @@ class FollowPackViewModel : ViewModel() { fun deleteItem(followSet: PeopleList) { accountViewModel.launchSigner { - accountViewModel.account.followLists.deleteFollowSet( + accountViewModel.account.starterPacks.deleteFollowSet( identifierTag = followSet.identifierTag, account = accountViewModel.account, ) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/list/PeopleListViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/list/PeopleListViewModel.kt index 94e853c494..808b175ada 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/list/PeopleListViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/list/PeopleListViewModel.kt @@ -22,7 +22,7 @@ package com.vitorpamplona.amethyst.ui.screen.loggedIn.lists.list import androidx.compose.runtime.Stable import androidx.lifecycle.ViewModel -import com.vitorpamplona.amethyst.commons.model.nip51Lists.peopleList.PeopleList +import com.vitorpamplona.amethyst.commons.model.nip51Lists.followSets.PeopleList import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel @Stable @@ -33,7 +33,7 @@ class PeopleListViewModel : ViewModel() { this.accountViewModel = accountViewModel } - fun listFlow() = accountViewModel.account.peopleLists.uiListFlow + fun listFlow() = accountViewModel.account.followSets.uiListFlow fun cloneItem( followSet: PeopleList, @@ -41,7 +41,7 @@ class PeopleListViewModel : ViewModel() { customDescription: String?, ) { accountViewModel.launchSigner { - accountViewModel.account.peopleLists.cloneFollowSet( + accountViewModel.account.followSets.cloneFollowSet( currentPeopleList = followSet, customCloneName = customName, customCloneDescription = customDescription, @@ -52,7 +52,7 @@ class PeopleListViewModel : ViewModel() { fun deleteItem(followSet: PeopleList) { accountViewModel.launchSigner { - accountViewModel.account.peopleLists.deleteFollowSet( + accountViewModel.account.followSets.deleteFollowSet( identifierTag = followSet.identifierTag, account = accountViewModel.account, ) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/list/metadata/FollowPackMetadataViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/list/metadata/FollowPackMetadataViewModel.kt index 695e5e0985..89c0ab56f6 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/list/metadata/FollowPackMetadataViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/list/metadata/FollowPackMetadataViewModel.kt @@ -31,7 +31,7 @@ import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.vitorpamplona.amethyst.Amethyst import com.vitorpamplona.amethyst.commons.model.mediaServers.ServerType -import com.vitorpamplona.amethyst.commons.model.nip51Lists.peopleList.PeopleList +import com.vitorpamplona.amethyst.commons.model.nip51Lists.followSets.PeopleList import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.avif_metadata_strip_failed import com.vitorpamplona.amethyst.commons.resources.failed_to_upload_media_no_details @@ -83,7 +83,7 @@ class FollowPackMetadataViewModel : ViewModel() { } fun load(dTag: String) { - peopleList = account.followLists.selectList(dTag) + peopleList = account.starterPacks.selectList(dTag) name.value = TextFieldValue(peopleList?.title ?: "") picture.value = TextFieldValue(peopleList?.image ?: "") description.value = TextFieldValue(peopleList?.description ?: "") @@ -94,14 +94,14 @@ class FollowPackMetadataViewModel : ViewModel() { val peopleList = peopleList if (peopleList == null) { val newListIdentifier = - accountViewModel.account.followLists.addFollowList( + accountViewModel.account.starterPacks.addFollowList( name = name.value.text, desc = description.value.text, image = picture.value.text, account = accountViewModel.account, ) } else { - accountViewModel.account.followLists.updateMetadata( + accountViewModel.account.starterPacks.updateMetadata( name = name.value.text, desc = description.value.text, image = picture.value.text, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/list/metadata/PeopleListMetadataViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/list/metadata/PeopleListMetadataViewModel.kt index 9e5ebac387..70a193bb50 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/list/metadata/PeopleListMetadataViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/list/metadata/PeopleListMetadataViewModel.kt @@ -31,7 +31,7 @@ import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.vitorpamplona.amethyst.Amethyst import com.vitorpamplona.amethyst.commons.model.mediaServers.ServerType -import com.vitorpamplona.amethyst.commons.model.nip51Lists.peopleList.PeopleList +import com.vitorpamplona.amethyst.commons.model.nip51Lists.followSets.PeopleList import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.avif_metadata_strip_failed import com.vitorpamplona.amethyst.commons.resources.failed_to_upload_media_no_details @@ -83,7 +83,7 @@ class PeopleListMetadataViewModel : ViewModel() { } fun load(dTag: String) { - peopleList = account.peopleLists.selectList(dTag) + peopleList = account.followSets.selectList(dTag) name.value = TextFieldValue(peopleList?.title ?: "") picture.value = TextFieldValue(peopleList?.image ?: "") description.value = TextFieldValue(peopleList?.description ?: "") @@ -95,14 +95,14 @@ class PeopleListMetadataViewModel : ViewModel() { accountViewModel.launchSigner { val peopleList = peopleList if (peopleList == null) { - accountViewModel.account.peopleLists.addFollowList( + accountViewModel.account.followSets.addFollowList( listName = name.value.text, listDescription = description.value.text, listImage = picture.value.text, account = accountViewModel.account, ) } else { - accountViewModel.account.peopleLists.updateMetadata( + accountViewModel.account.followSets.updateMetadata( listName = name.value.text, listDescription = description.value.text, listImage = picture.value.text, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/memberEdit/FollowListAndPackAndUserView.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/memberEdit/FollowListAndPackAndUserView.kt index 7f61e68033..4dbd832a96 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/memberEdit/FollowListAndPackAndUserView.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/lists/memberEdit/FollowListAndPackAndUserView.kt @@ -63,9 +63,9 @@ fun FollowListAndPackAndUserView( accountViewModel: AccountViewModel, nav: INav, ) { - val followSetsState by accountViewModel.account.peopleLists.uiListFlow + val followSetsState by accountViewModel.account.followSets.uiListFlow .collectAsStateWithLifecycle() - val followPackFeedState by accountViewModel.account.followLists.uiListFlow + val followPackFeedState by accountViewModel.account.starterPacks.uiListFlow .collectAsStateWithLifecycle() val userName by observeUserName(userToAddOrRemove, accountViewModel) @@ -114,7 +114,7 @@ fun FollowListAndPackAndUserView( userIsPublicMember = list.publicMembers.contains(userToAddOrRemove), onRemoveUser = { accountViewModel.launchSigner { - accountViewModel.account.peopleLists.removeUserFromSet( + accountViewModel.account.followSets.removeUserFromSet( userToAddOrRemove, isPrivate = list.privateMembers.contains(userToAddOrRemove), list.identifierTag, @@ -129,7 +129,7 @@ fun FollowListAndPackAndUserView( }, onAddUserToList = { userShouldBePrivate -> accountViewModel.launchSigner { - accountViewModel.account.peopleLists.addUserToSet( + accountViewModel.account.followSets.addUserToSet( userToAddOrRemove, list.identifierTag, userShouldBePrivate, @@ -189,7 +189,7 @@ fun FollowListAndPackAndUserView( }, onRemoveUser = { accountViewModel.launchSigner { - accountViewModel.account.followLists.removeUserFromSet( + accountViewModel.account.starterPacks.removeUserFromSet( userToAddOrRemove, list.identifierTag, accountViewModel.account, @@ -199,7 +199,7 @@ fun FollowListAndPackAndUserView( memberSize = list.publicMembers.size, onAddUserToList = { accountViewModel.launchSigner { - accountViewModel.account.followLists.addUserToSet( + accountViewModel.account.starterPacks.addUserToSet( userToAddOrRemove, list.identifierTag, accountViewModel.account, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/profile/followers/FollowersTabHeader.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/profile/followers/FollowersTabHeader.kt index 8f5a8fe47f..ce6c0e9dc2 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/profile/followers/FollowersTabHeader.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/profile/followers/FollowersTabHeader.kt @@ -28,7 +28,7 @@ import com.vitorpamplona.amethyst.commons.model.User import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.number_followers import com.vitorpamplona.amethyst.commons.ui.stringRes -import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUserContactCardsFollowerCount +import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUserAssertionsFollowerCount import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.followers.dal.UserProfileFollowersUserFeedViewModel @@ -38,7 +38,7 @@ fun FollowersTabHeader( followersFeedViewModel: UserProfileFollowersUserFeedViewModel, accountViewModel: AccountViewModel, ) { - val followerCount by observeUserContactCardsFollowerCount(baseUser, accountViewModel) + val followerCount by observeUserAssertionsFollowerCount(baseUser, accountViewModel) if (followerCount == "--") { FollowersTabHeaderLocal(followersFeedViewModel, accountViewModel) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/profile/header/UserNicknameCard.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/profile/header/UserNicknameCard.kt index e614a462df..5e666661c5 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/profile/header/UserNicknameCard.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/profile/header/UserNicknameCard.kt @@ -73,8 +73,8 @@ fun UserNicknameCard( WatchAndLoadMyEmojiList(accountViewModel) EditNicknameDialog( user = baseUser, - contactCards = accountViewModel.account.contactCards, - onSave = { petName, summary -> accountViewModel.updateContactCardPetName(baseUser, petName, summary) }, + userAssertions = accountViewModel.account.userAssertions, + onSave = { petName, summary -> accountViewModel.updateUserAssertionPetName(baseUser, petName, summary) }, onDismiss = { isEditDialogOpen.value = false }, ) } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/profile/header/UserProfileDropDownMenu.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/profile/header/UserProfileDropDownMenu.kt index 07a9bc477b..78f5d38f66 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/profile/header/UserProfileDropDownMenu.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/profile/header/UserProfileDropDownMenu.kt @@ -71,8 +71,8 @@ fun UserProfileDropDownMenu( WatchAndLoadMyEmojiList(accountViewModel) EditNicknameDialog( user = user, - contactCards = accountViewModel.account.contactCards, - onSave = { petName, summary -> accountViewModel.updateContactCardPetName(user, petName, summary) }, + userAssertions = accountViewModel.account.userAssertions, + onSave = { petName, summary -> accountViewModel.updateUserAssertionPetName(user, petName, summary) }, onDismiss = { isNicknameDialogOpen.value = false }, ) } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/relays/AllRelayListScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/relays/AllRelayListScreen.kt index 51a2e0107d..42082044f7 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/relays/AllRelayListScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/relays/AllRelayListScreen.kt @@ -109,7 +109,7 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.relays.connected.ConnectedR import com.vitorpamplona.amethyst.ui.screen.loggedIn.relays.connected.renderConnectedItems import com.vitorpamplona.amethyst.ui.screen.loggedIn.relays.dm.DMRelayListViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.relays.dm.renderDMItems -import com.vitorpamplona.amethyst.ui.screen.loggedIn.relays.feeds.RelayFeedsListViewModel +import com.vitorpamplona.amethyst.ui.screen.loggedIn.relays.feeds.FavoriteRelayListViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.relays.feeds.renderRelayFeedsItems import com.vitorpamplona.amethyst.ui.screen.loggedIn.relays.indexer.IndexerRelayListViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.relays.indexer.renderIndexerItems @@ -148,7 +148,7 @@ fun AllRelayListScreen( val broadcastViewModel: BroadcastRelayListViewModel = viewModel() val indexerViewModel: IndexerRelayListViewModel = viewModel() val proxyViewModel: ProxyRelayListViewModel = viewModel() - val relayFeedsViewModel: RelayFeedsListViewModel = viewModel() + val relayFeedsViewModel: FavoriteRelayListViewModel = viewModel() dmViewModel.init(accountViewModel) keyPackageViewModel.init(accountViewModel) @@ -214,7 +214,7 @@ fun MappedAllRelayListView( broadcastViewModel: BroadcastRelayListViewModel, indexerViewModel: IndexerRelayListViewModel, proxyViewModel: ProxyRelayListViewModel, - relayFeedsViewModel: RelayFeedsListViewModel, + relayFeedsViewModel: FavoriteRelayListViewModel, accountViewModel: AccountViewModel, nav: INav, ) { diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/relays/KindDisplayName.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/relays/KindDisplayName.kt index 0684f76185..c8b6e75aaf 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/relays/KindDisplayName.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/relays/KindDisplayName.kt @@ -248,12 +248,11 @@ import com.vitorpamplona.quartz.nip50Search.SearchRelayListEvent import com.vitorpamplona.quartz.nip51Lists.PinListEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.BookmarkListEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.OldBookmarkListEvent -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.bookmarkSet.BookmarkSetEvent +import com.vitorpamplona.quartz.nip51Lists.followSet.FollowSetEvent import com.vitorpamplona.quartz.nip51Lists.geohashList.GeohashListEvent -import com.vitorpamplona.quartz.nip51Lists.hashtagList.InterestListEvent -import com.vitorpamplona.quartz.nip51Lists.labeledBookmarkList.BookmarkSetEvent +import com.vitorpamplona.quartz.nip51Lists.interestList.InterestListEvent import com.vitorpamplona.quartz.nip51Lists.muteList.MuteListEvent -import com.vitorpamplona.quartz.nip51Lists.peopleList.FollowSetEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.BlockedRelayListEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.BroadcastRelayListEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.FavoriteRelayListEvent @@ -261,6 +260,7 @@ import com.vitorpamplona.quartz.nip51Lists.relayLists.IndexerRelayListEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.ProxyRelayListEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.TrustedRelayListEvent import com.vitorpamplona.quartz.nip51Lists.relaySets.RelaySetEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import com.vitorpamplona.quartz.nip51Lists.videoCurationSet.VideoCurationSetEvent import com.vitorpamplona.quartz.nip52Calendar.appt.day.CalendarDateSlotEvent import com.vitorpamplona.quartz.nip52Calendar.appt.time.CalendarTimeSlotEvent @@ -274,7 +274,7 @@ import com.vitorpamplona.quartz.nip53LiveActivities.presence.MeetingRoomPresence import com.vitorpamplona.quartz.nip53LiveActivities.streaming.LiveActivitiesEvent import com.vitorpamplona.quartz.nip54Wiki.WikiArticleEvent import com.vitorpamplona.quartz.nip56Reports.ReportEvent -import com.vitorpamplona.quartz.nip57Zaps.LnZapPrivateEvent +import com.vitorpamplona.quartz.nip57Zaps.PrivateZapEvent import com.vitorpamplona.quartz.nip57Zaps.ZapReceiptEvent import com.vitorpamplona.quartz.nip57Zaps.ZapRequestEvent import com.vitorpamplona.quartz.nip58Badges.accepted.AcceptedBadgeSetEvent @@ -434,7 +434,7 @@ fun kindDisplayName(kind: Int): StringResource? = Bolt12ZapEvent.KIND -> Res.string.kind_zaps NwcRequestEvent.KIND -> Res.string.kind_nwc_request NwcResponseEvent.KIND -> Res.string.kind_nwc_response - LnZapPrivateEvent.KIND -> Res.string.kind_private_zaps + PrivateZapEvent.KIND -> Res.string.kind_private_zaps ZapRequestEvent.KIND -> Res.string.kind_zap_req LongFormContentEvent.KIND -> Res.string.kind_blogs MeetingRoomEvent.KIND -> Res.string.kind_meeting_room diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/relays/feeds/RelayFeedsListViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/relays/feeds/FavoriteRelayListViewModel.kt similarity index 90% rename from amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/relays/feeds/RelayFeedsListViewModel.kt rename to amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/relays/feeds/FavoriteRelayListViewModel.kt index aab6d86fd0..91fd7cf9a6 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/relays/feeds/RelayFeedsListViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/relays/feeds/FavoriteRelayListViewModel.kt @@ -25,12 +25,12 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.relays.common.BasicRelaySet import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl @Stable -class RelayFeedsListViewModel : BasicRelaySetupInfoModel() { +class FavoriteRelayListViewModel : BasicRelaySetupInfoModel() { override fun getRelayList(): List = - account.relayFeedsList.flow.value + account.favoriteRelayList.flow.value .toList() override suspend fun saveRelayList(urlList: List) { - account.saveRelayFeedsList(urlList) + account.saveFavoriteRelayList(urlList) } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/relays/feeds/RelayFeedsListView.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/relays/feeds/RelayFeedsListView.kt index 2c77021427..cf07d2053d 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/relays/feeds/RelayFeedsListView.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/relays/feeds/RelayFeedsListView.kt @@ -45,8 +45,8 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.relays.common.RelayUrlEditF import com.vitorpamplona.amethyst.ui.screen.loggedIn.relays.common.relaySetupInfoBuilder @Composable -fun RelayFeedsList( - postViewModel: RelayFeedsListViewModel, +fun FavoriteRelayList( + postViewModel: FavoriteRelayListViewModel, accountViewModel: AccountViewModel, onClose: () -> Unit, nav: INav, @@ -71,7 +71,7 @@ fun RelayFeedsList( fun LazyListScope.renderRelayFeedsItems( feedState: List, - postViewModel: RelayFeedsListViewModel, + postViewModel: FavoriteRelayListViewModel, accountViewModel: AccountViewModel, nav: INav, dragState: RelayDragState? = null, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/threadview/ThreadFeedView.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/threadview/ThreadFeedView.kt index 74d6155773..75050af4ad 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/threadview/ThreadFeedView.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/threadview/ThreadFeedView.kt @@ -176,17 +176,17 @@ import com.vitorpamplona.amethyst.ui.note.types.DisplayBlockedRelayList import com.vitorpamplona.amethyst.ui.note.types.DisplayBroadcastRelayList import com.vitorpamplona.amethyst.ui.note.types.DisplayContactList import com.vitorpamplona.amethyst.ui.note.types.DisplayDMRelayList -import com.vitorpamplona.amethyst.ui.note.types.DisplayFollowList +import com.vitorpamplona.amethyst.ui.note.types.DisplayFavoriteRelayList import com.vitorpamplona.amethyst.ui.note.types.DisplayIndexerRelayList import com.vitorpamplona.amethyst.ui.note.types.DisplayNIP65RelayList import com.vitorpamplona.amethyst.ui.note.types.DisplayPeopleList import com.vitorpamplona.amethyst.ui.note.types.DisplayProxyRelayList -import com.vitorpamplona.amethyst.ui.note.types.DisplayRelayFeedsList import com.vitorpamplona.amethyst.ui.note.types.DisplayRelaySet import com.vitorpamplona.amethyst.ui.note.types.DisplaySearchRelayList +import com.vitorpamplona.amethyst.ui.note.types.DisplayStarterPack import com.vitorpamplona.amethyst.ui.note.types.DisplayTrustedRelayList import com.vitorpamplona.amethyst.ui.note.types.EditState -import com.vitorpamplona.amethyst.ui.note.types.FileHeaderDisplay +import com.vitorpamplona.amethyst.ui.note.types.FileMetadataDisplay import com.vitorpamplona.amethyst.ui.note.types.FileStorageHeaderDisplay import com.vitorpamplona.amethyst.ui.note.types.MAX_THREAD_SECTIONS import com.vitorpamplona.amethyst.ui.note.types.PictureDisplay @@ -223,7 +223,6 @@ import com.vitorpamplona.amethyst.ui.note.types.RenderHighlight import com.vitorpamplona.amethyst.ui.note.types.RenderInteractiveStory import com.vitorpamplona.amethyst.ui.note.types.RenderLearningResource import com.vitorpamplona.amethyst.ui.note.types.RenderLiveActivityChatMessage -import com.vitorpamplona.amethyst.ui.note.types.RenderLnZap import com.vitorpamplona.amethyst.ui.note.types.RenderMeetingRoomEvent import com.vitorpamplona.amethyst.ui.note.types.RenderMeetingSpaceEvent import com.vitorpamplona.amethyst.ui.note.types.RenderMusicPlaylist @@ -263,6 +262,7 @@ import com.vitorpamplona.amethyst.ui.note.types.RenderTextModificationEvent import com.vitorpamplona.amethyst.ui.note.types.RenderTorrent import com.vitorpamplona.amethyst.ui.note.types.RenderTorrentComment import com.vitorpamplona.amethyst.ui.note.types.RenderZapPoll +import com.vitorpamplona.amethyst.ui.note.types.RenderZapReceipt import com.vitorpamplona.amethyst.ui.note.types.ReplyRenderType import com.vitorpamplona.amethyst.ui.note.types.VideoDisplay import com.vitorpamplona.amethyst.ui.note.types.VoiceHeader @@ -343,8 +343,7 @@ import com.vitorpamplona.quartz.nip43RelayMembers.list.RelayMembershipListEvent import com.vitorpamplona.quartz.nip43RelayMembers.removeMember.RelayRemoveMemberEvent import com.vitorpamplona.quartz.nip50Search.SearchRelayListEvent import com.vitorpamplona.quartz.nip51Lists.PinListEvent -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent -import com.vitorpamplona.quartz.nip51Lists.peopleList.FollowSetEvent +import com.vitorpamplona.quartz.nip51Lists.followSet.FollowSetEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.BlockedRelayListEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.BroadcastRelayListEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.FavoriteRelayListEvent @@ -353,6 +352,7 @@ import com.vitorpamplona.quartz.nip51Lists.relayLists.ProxyRelayListEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.TrustedRelayListEvent import com.vitorpamplona.quartz.nip51Lists.relaySets.RelaySetEvent import com.vitorpamplona.quartz.nip51Lists.releaseArtifactSet.ReleaseArtifactSetEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import com.vitorpamplona.quartz.nip52Calendar.appt.day.CalendarDateSlotEvent import com.vitorpamplona.quartz.nip52Calendar.appt.time.CalendarTimeSlotEvent import com.vitorpamplona.quartz.nip53LiveActivities.chat.LiveActivitiesChatMessageEvent @@ -897,13 +897,13 @@ private fun FullBleedNoteCompose( } else if (noteEvent is BaseVoiceEvent) { VoiceHeader(noteEvent, baseNote, accountViewModel, nav) } else if (noteEvent is FileMetadataEvent) { - FileHeaderDisplay(baseNote, roundedCorner = true, ContentScale.FillWidth, accountViewModel = accountViewModel) + FileMetadataDisplay(baseNote, roundedCorner = true, ContentScale.FillWidth, accountViewModel = accountViewModel) } else if (noteEvent is FileStorageHeaderEvent) { FileStorageHeaderDisplay(baseNote, roundedCorner = true, ContentScale.FillWidth, accountViewModel = accountViewModel) } else if (noteEvent is FollowSetEvent) { DisplayPeopleList(baseNote, backgroundColor, accountViewModel, nav) } else if (noteEvent is StarterPackEvent) { - DisplayFollowList(baseNote, false, accountViewModel, nav) + DisplayStarterPack(baseNote, false, accountViewModel, nav) } else if (noteEvent is ContactListEvent) { DisplayContactList(baseNote, accountViewModel, nav) } else if (noteEvent is AudioTrackEvent) { @@ -978,7 +978,7 @@ private fun FullBleedNoteCompose( } else if (noteEvent is AdvertisedRelayListEvent) { DisplayNIP65RelayList(baseNote, backgroundColor, accountViewModel, nav) } else if (noteEvent is ZapReceiptEvent) { - RenderLnZap(baseNote, quotesLeft = 3, backgroundColor = backgroundColor, accountViewModel = accountViewModel, nav = nav) + RenderZapReceipt(baseNote, quotesLeft = 3, backgroundColor = backgroundColor, accountViewModel = accountViewModel, nav = nav) } else if (noteEvent is NutzapEvent) { RenderNutzap(baseNote, quotesLeft = 3, backgroundColor = backgroundColor, accountViewModel = accountViewModel, nav = nav) } else if (noteEvent is OnchainZapEvent) { @@ -996,7 +996,7 @@ private fun FullBleedNoteCompose( } else if (noteEvent is TrustedRelayListEvent) { DisplayTrustedRelayList(baseNote, backgroundColor, accountViewModel, nav) } else if (noteEvent is FavoriteRelayListEvent) { - DisplayRelayFeedsList(baseNote, backgroundColor, accountViewModel, nav) + DisplayFavoriteRelayList(baseNote, backgroundColor, accountViewModel, nav) } else if (noteEvent is IndexerRelayListEvent) { DisplayIndexerRelayList(baseNote, backgroundColor, accountViewModel, nav) } else if (noteEvent is BroadcastRelayListEvent) { diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/video/FileHeaderCardCompose.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/video/FileMetadataCardCompose.kt similarity index 93% rename from amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/video/FileHeaderCardCompose.kt rename to amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/video/FileMetadataCardCompose.kt index 523cb12efd..4b74c1ddf4 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/video/FileHeaderCardCompose.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/video/FileMetadataCardCompose.kt @@ -47,7 +47,7 @@ import com.vitorpamplona.amethyst.ui.components.ZoomableContentView import com.vitorpamplona.amethyst.ui.components.collectContentWarningReasons import com.vitorpamplona.amethyst.ui.components.mediaSizingModifier import com.vitorpamplona.amethyst.ui.note.ReactionsRow -import com.vitorpamplona.amethyst.ui.note.types.FileHeaderAttachmentCard +import com.vitorpamplona.amethyst.ui.note.types.FileMetadataAttachmentCard import com.vitorpamplona.amethyst.ui.note.types.toMediaContent import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.quartz.nip01Core.core.Event @@ -55,7 +55,7 @@ import com.vitorpamplona.quartz.nip36SensitiveContent.isSensitiveOrNSFW import com.vitorpamplona.quartz.nip94FileMetadata.FileMetadataEvent @Composable -fun FileHeaderCardCompose( +fun FileMetadataCardCompose( baseNote: Note, accountViewModel: AccountViewModel, nav: INav, @@ -70,7 +70,7 @@ fun FileHeaderCardCompose( UserCardHeader(baseNote, accountViewModel, nav) // Image content - FileHeaderCardImage(baseNote, event, backgroundColor, accountViewModel) + FileMetadataCardImage(baseNote, event, backgroundColor, accountViewModel) // Reactions row ReactionsRow( @@ -83,12 +83,12 @@ fun FileHeaderCardCompose( ) // Title and content - FileHeaderCardCaption(event) + FileMetadataCardCaption(event) } } @Composable -private fun FileHeaderCardImage( +private fun FileMetadataCardImage( note: Note, event: FileMetadataEvent, backgroundColor: MutableState, @@ -108,7 +108,7 @@ private fun FileHeaderCardImage( // Reachable despite VideoFeedFilter admitting only image/video types: the filter accepts on // `urls().any { … }` while this card renders `url()`, the first tag — so a multi-mirror event // whose first URL is unrenderable lands here. The gate wraps it for the same reason it wraps - // the viewer in FileHeaderDisplay: a content warning is about the file, and the card still + // the viewer in FileMetadataDisplay: a content warning is about the file, and the card still // spells out its filename, alt text, MIME and size. Sizing stays on the gate's defaults // (fillMaxWidth, no backdrop) — a link card has no aspect ratio to reserve and no blurhash // to show behind it. @@ -119,7 +119,7 @@ private fun FileHeaderCardImage( preloadUrls = emptyList(), accountViewModel = accountViewModel, ) { - FileHeaderAttachmentCard(event, fullUrl, mimeType) + FileMetadataAttachmentCard(event, fullUrl, mimeType) } return } @@ -145,7 +145,7 @@ private fun FileHeaderCardImage( } @Composable -internal fun FileHeaderCardCaption(videoEvent: FileMetadataEvent) { +internal fun FileMetadataCardCaption(videoEvent: FileMetadataEvent) { val event = (videoEvent as? Event) ?: return val title = videoEvent.summary() diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/video/VideoScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/video/VideoScreen.kt index d9b3fe531b..7615245745 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/video/VideoScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/video/VideoScreen.kt @@ -200,7 +200,7 @@ fun VideoFeedLoaded( } item.event is FileMetadataEvent -> { - FileHeaderCardCompose(item, accountViewModel, nav) + FileMetadataCardCompose(item, accountViewModel, nav) HorizontalDivider( thickness = DividerThickness, diff --git a/amethyst/src/test/java/com/vitorpamplona/amethyst/service/resourceusage/ResourceUsageLedgerTest.kt b/amethyst/src/test/java/com/vitorpamplona/amethyst/service/resourceusage/ResourceUsageLedgerTest.kt index 63bbe4a78b..6f0365319d 100644 --- a/amethyst/src/test/java/com/vitorpamplona/amethyst/service/resourceusage/ResourceUsageLedgerTest.kt +++ b/amethyst/src/test/java/com/vitorpamplona/amethyst/service/resourceusage/ResourceUsageLedgerTest.kt @@ -43,7 +43,7 @@ import com.vitorpamplona.quartz.nip01Core.relay.commands.toRelay.ReqCmd import com.vitorpamplona.quartz.nip01Core.relay.filters.Filter import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl import com.vitorpamplona.quartz.nip01Core.signers.NostrSigner -import com.vitorpamplona.quartz.nip57Zaps.LnZapPrivateEvent +import com.vitorpamplona.quartz.nip57Zaps.PrivateZapEvent import com.vitorpamplona.quartz.nip57Zaps.ZapRequestEvent import io.mockk.every import io.mockk.mockk @@ -650,7 +650,7 @@ class MeteringNostrSignerTest { fromPublicKey: HexKey, ) = "dec44" - override suspend fun decryptZapEvent(event: ZapRequestEvent): LnZapPrivateEvent = throw UnsupportedOperationException("fake") + override suspend fun decryptZapEvent(event: ZapRequestEvent): PrivateZapEvent = throw UnsupportedOperationException("fake") override suspend fun deriveKey(nonce: HexKey): HexKey = "bb".repeat(32) diff --git a/cli/plans/archive/2026-04-23-nip17-dm.md b/cli/plans/archive/2026-04-23-nip17-dm.md index 28918e37e2..7a46443a45 100644 --- a/cli/plans/archive/2026-04-23-nip17-dm.md +++ b/cli/plans/archive/2026-04-23-nip17-dm.md @@ -42,7 +42,7 @@ DMs); on `list`/`await` it filters by counter-party. | Build `kind:14` chat message template | `ChatMessageEvent.build(msg, to, …)` | `quartz/.../nip17Dm/messages/ChatMessageEvent.kt:51` | | Sign + seal + wrap (one wrap per recipient incl. self) | `NIP17Factory().createMessageNIP17(template, signer)` | `quartz/.../nip17Dm/NIP17Factory.kt:37` | | `GiftWrapEvent.create / unwrapOrNull / recipientPubKey` | `GiftWrapEvent` (kind 1059) | `quartz/.../nip59Giftwrap/wraps/GiftWrapEvent.kt` | -| Inner seal layer (kind 13) | `SealedRumorEvent` | `quartz/.../nip59Giftwrap/seals/SealedRumorEvent.kt` | +| Inner seal layer (kind 13) | `SealEvent` | `quartz/.../nip59Giftwrap/seals/SealEvent.kt` | | NIP-44 v2 encrypt/decrypt (called from wrap/seal) | `Nip44` singleton | `quartz/.../nip44Encryption/Nip44.kt` | | Resolve recipient relay lists (10050 / 10051 / 10002) | `RecipientRelayFetcher.fetchRelayLists` | `quartz/.../marmot/RecipientRelayFetcher.kt:80` | | Publish + per-relay ACK | `Context.publish(event, relays)` | `cli/.../Context.kt:154` | @@ -58,7 +58,7 @@ Everything above is already on the JVM classpath of the `cli` module. | Piece | Status | Current | Target | Notes | |---|---|---|---|---| -| `NIP17Factory`, `GiftWrapEvent`, `SealedRumorEvent`, `Nip44`, `ChatMessageEvent` | ✅ Reuse | `quartz/` | — | Pure protocol; CLI calls directly. | +| `NIP17Factory`, `GiftWrapEvent`, `SealEvent`, `Nip44`, `ChatMessageEvent` | ✅ Reuse | `quartz/` | — | Pure protocol; CLI calls directly. | | `RecipientRelayFetcher.fetchRelayLists` | ✅ Reuse | `quartz/.../marmot/` | — | Already used by `AwaitCommands.awaitKeyPackage`; same call shape. | | `filterGiftWrapsToPubkey` | 📦 Extract | `amethyst/.../service/relayClient/reqCommand/account/nip59GiftWraps/FilterGiftWrapsToPubkey.kt:31` | `commons/.../relayClient/nip17Dm/FilterGiftWrapsToPubkey.kt` | Pure function, no Android deps. Update Android caller (`AccountGiftWrapsEoseManager.kt:55`) in the same commit. | | Per-recipient relay routing (kind:10050 → 10002 read → bootstrap) | 🆕 New (in CLI) | inline inside `Account.computeRelayListToBroadcast` (`amethyst/.../model/Account.kt:908`) | `cli/.../commands/DmCommands.kt` (private helper) | Tiny — three-line fallback. Promoting it to commons can wait until a second consumer appears. | @@ -133,7 +133,7 @@ raw = ctx.drain(filters, timeoutMs = --timeout * 1000 ?: 8_000) ↓ messages = raw.mapNotNull { (relay, event) -> if (event !is GiftWrapEvent) return@mapNotNull null - val sealed = event.unwrapOrNull(ctx.signer) as? SealedRumorEvent ?: return@mapNotNull null + val sealed = event.unwrapOrNull(ctx.signer) as? SealEvent ?: return@mapNotNull null val inner = sealed.unsealOrNull(ctx.signer) as? ChatMessageEvent ?: return@mapNotNull null DecryptedMsg(inner, relay, event.id) }.dedupBy { it.inner.id } diff --git a/commons/plans/2026-05-04-custom-feeds-plan.md b/commons/plans/2026-05-04-custom-feeds-plan.md index 1a54116a6a..f572a0d9cf 100644 --- a/commons/plans/2026-05-04-custom-feeds-plan.md +++ b/commons/plans/2026-05-04-custom-feeds-plan.md @@ -463,7 +463,7 @@ class FeedBuilderState(initial: FeedDefinition?) { - DVM request goes to DVM's advertised relays (from kind 31990 `relay` tags) - Response subscription listens on both user's relays AND DVM's relays - Use `MetadataPreloader` for bulk-fetching author metadata of returned notes -- Reuse existing `NIP90ContentDiscoveryRequestEvent.build()` pattern from Quartz +- Reuse existing `DvmContentDiscoveryRequestEvent.build()` pattern from Quartz ### Phase 7: Publish/Import (kind 31890) @@ -532,7 +532,7 @@ commons/src/commonTest/kotlin/.../feeds/custom/ | `TopFilter` | `amethyst/.../AccountSettings.kt` | Reference; `FeedSource.toTopFilter()` for bridge | | `FavoriteAlgoFeedsOrchestrator` | `amethyst/.../algoFeeds/` | Extract to commons for DVM reuse | | `FavoriteAlgoFeedsListEvent` (kind 10090) | `quartz/.../nip51Lists/` | Pinned feed sync | -| `NIP90ContentDiscoveryRequestEvent` | `quartz/.../nip90Dvms/` | DVM request building | +| `DvmContentDiscoveryRequestEvent` | `quartz/.../nip90Dvms/` | DVM request building | | `AppDefinitionEvent` (kind 31990) | `quartz/.../nip89AppHandlers/` | DVM marketplace discovery | | `NAddress` | `quartz/.../nip19Bech32/entities/` | naddr encode/decode | | `Nip19Parser` | `quartz/.../nip19Bech32/` | Detect pasted naddr | @@ -542,7 +542,7 @@ commons/src/commonTest/kotlin/.../feeds/custom/ | `PinnedNavBarState` | `desktopApp/.../deck/PinnedNavBarState.kt` | Reference pattern for pin state | | `HomeFeed` rendering | `desktopApp/.../home/` | Phase 2 content reuse | | `BaseAddressableEvent` | `quartz/.../nip01Core/core/` | Base for kind 31890 | -| `PeopleListEvent` / `InterestSetEvent` | `quartz/.../nip51Lists/` | Resolve ATag -> members | +| `FollowSetEvent` / `InterestSetEvent` | `quartz/.../nip51Lists/` | Resolve ATag -> members | | `MetadataPreloader` | `commons/.../relayClient/` | Bulk metadata fetch for feed results | | `FeedMetadataCoordinator` | `commons/.../relayClient/` | Coordinate metadata for visible notes | | `ComposeSubscriptionManager` | `commons/.../relayClient/` | Subscription lifecycle | diff --git a/commons/plans/2026-08-30-commons-migration-sweep.md b/commons/plans/2026-08-30-commons-migration-sweep.md index 20982ddae2..4d148d22a9 100644 --- a/commons/plans/2026-08-30-commons-migration-sweep.md +++ b/commons/plans/2026-08-30-commons-migration-sweep.md @@ -934,7 +934,7 @@ measured picture. are handled; the 9 without a dedicated `EventCache` overload (`TextNoteEvent`, `ContactListEvent`, `CommentEvent`, `AdvertisedRelayListEvent`, `BlossomServersEvent`, `BookmarkListEvent`, - `OldBookmarkListEvent`, `ChatMessageRelayListEvent`, `FollowListEvent`) fall + `OldBookmarkListEvent`, `DmRelayListEvent`, `StarterPackEvent`) fall into the generic replaceable/addressable group. - **13 of 13 core read methods match** by name and signature. - **Feed retention is already aligned** — both platforms hold feed content @@ -982,7 +982,7 @@ a deletion: ~500 lines of genuinely Desktop-specific state survive, and the concentrated in five places (metadata, contact list, follow pack, live activity, `clear`) and re-derive cleanly from the event after consume. 4. **Two Desktop-shaped `consume` overloads do not generalize** — the NIP-47 - `LnZapPaymentRequestEvent` one takes a `zappedNote` and an `onResponse` + `NwcRequestEvent` one takes a `zappedNote` and an `onResponse` callback, and the response one drives `paymentTracker` + `appScope`. Android reaches the same tracker through account state. Keep them Desktop-side. 5. **`clear()`** has only 2 production call sites (`Main.kt`, logout/account diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/account/AccountBootstrapEvents.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/account/AccountBootstrapEvents.kt index f5e80b7685..07b0376e67 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/account/AccountBootstrapEvents.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/account/AccountBootstrapEvents.kt @@ -62,8 +62,8 @@ data class AccountBootstrapEvents( val keyPackageRelayList: KeyPackageRelayListEvent, val searchRelayList: SearchRelayListEvent, val indexerRelayList: IndexerRelayListEvent, - val channelList: PublicChatListEvent, - val relayFeedsList: FavoriteRelayListEvent, + val publicChatList: PublicChatListEvent, + val favoriteRelayList: FavoriteRelayListEvent, ) { /** All nine signed events in publication order. */ fun all(): List = @@ -75,8 +75,8 @@ data class AccountBootstrapEvents( keyPackageRelayList, searchRelayList, indexerRelayList, - channelList, - relayFeedsList, + publicChatList, + favoriteRelayList, ) } @@ -109,6 +109,6 @@ fun bootstrapAccountEvents( keyPackageRelayList = KeyPackageRelayListEvent.create(DefaultNIP65RelaySet.toList(), signer), searchRelayList = SearchRelayListEvent.create(DefaultSearchRelayList.toList(), signer), indexerRelayList = IndexerRelayListEvent.create(DefaultIndexerRelayList.toList(), signer), - channelList = PublicChatListEvent.create(emptyList(), DefaultChannels, signer), - relayFeedsList = FavoriteRelayListEvent.create(DefaultGlobalRelays, signer), + publicChatList = PublicChatListEvent.create(emptyList(), DefaultChannels, signer), + favoriteRelayList = FavoriteRelayListEvent.create(DefaultGlobalRelays, signer), ) diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/backups/ReplaceableBackupConflict.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/backups/ReplaceableBackupConflict.kt index f32456f1c1..b1ffb3334d 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/backups/ReplaceableBackupConflict.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/backups/ReplaceableBackupConflict.kt @@ -39,7 +39,7 @@ import com.vitorpamplona.quartz.nip40Expiration.ExpirationTag import com.vitorpamplona.quartz.nip50Search.SearchRelayListEvent import com.vitorpamplona.quartz.nip51Lists.favoriteAlgoFeedsList.FavoriteAlgoFeedsListEvent import com.vitorpamplona.quartz.nip51Lists.geohashList.GeohashListEvent -import com.vitorpamplona.quartz.nip51Lists.hashtagList.InterestListEvent +import com.vitorpamplona.quartz.nip51Lists.interestList.InterestListEvent import com.vitorpamplona.quartz.nip51Lists.muteList.MuteListEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.BlockedRelayListEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.FavoriteRelayListEvent diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/cache/EventCache.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/cache/EventCache.kt index 1789346dcf..0954ef7a9e 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/cache/EventCache.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/cache/EventCache.kt @@ -290,14 +290,13 @@ import com.vitorpamplona.quartz.nip50Search.SearchRelayListEvent import com.vitorpamplona.quartz.nip51Lists.PinListEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.BookmarkListEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.OldBookmarkListEvent +import com.vitorpamplona.quartz.nip51Lists.bookmarkSet.BookmarkSetEvent import com.vitorpamplona.quartz.nip51Lists.favoriteAlgoFeedsList.FavoriteAlgoFeedsListEvent -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.followSet.FollowSetEvent import com.vitorpamplona.quartz.nip51Lists.geohashList.GeohashListEvent -import com.vitorpamplona.quartz.nip51Lists.hashtagList.InterestListEvent +import com.vitorpamplona.quartz.nip51Lists.interestList.InterestListEvent import com.vitorpamplona.quartz.nip51Lists.interestSet.InterestSetEvent -import com.vitorpamplona.quartz.nip51Lists.labeledBookmarkList.BookmarkSetEvent import com.vitorpamplona.quartz.nip51Lists.muteList.MuteListEvent -import com.vitorpamplona.quartz.nip51Lists.peopleList.FollowSetEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.BlockedRelayListEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.BroadcastRelayListEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.FavoriteRelayListEvent @@ -307,6 +306,7 @@ import com.vitorpamplona.quartz.nip51Lists.relayLists.TrustedRelayListEvent import com.vitorpamplona.quartz.nip51Lists.relaySets.RelaySetEvent import com.vitorpamplona.quartz.nip51Lists.releaseArtifactSet.ReleaseArtifactSetEvent import com.vitorpamplona.quartz.nip51Lists.simpleGroupList.SimpleGroupListEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import com.vitorpamplona.quartz.nip51Lists.videoCurationSet.VideoCurationSetEvent import com.vitorpamplona.quartz.nip52Calendar.appt.day.CalendarDateSlotEvent import com.vitorpamplona.quartz.nip52Calendar.appt.time.CalendarTimeSlotEvent @@ -327,9 +327,9 @@ import com.vitorpamplona.quartz.nip54Wiki.WikiRedirectEvent import com.vitorpamplona.quartz.nip56Reports.ReportEvent import com.vitorpamplona.quartz.nip57Zaps.ZapReceiptEvent import com.vitorpamplona.quartz.nip57Zaps.ZapRequestEvent -import com.vitorpamplona.quartz.nip57Zaps.validate.LnZapReceiptValidator import com.vitorpamplona.quartz.nip57Zaps.validate.LnurlEndpointResolver import com.vitorpamplona.quartz.nip57Zaps.validate.LnurlForm +import com.vitorpamplona.quartz.nip57Zaps.validate.ZapReceiptValidator import com.vitorpamplona.quartz.nip58Badges.accepted.AcceptedBadgeSetEvent import com.vitorpamplona.quartz.nip58Badges.award.BadgeAwardEvent import com.vitorpamplona.quartz.nip58Badges.definition.BadgeDefinitionEvent @@ -2252,7 +2252,7 @@ open class EventCache : val new = consumeBaseReplaceable(event, relay, wasVerified) if (relay != null && isRelaySignedGroupEvent(event, relay)) { val latest = getOrCreateAddressableNote(event.address()).event as? GroupRolesEvent - latest?.let { getOrCreateRelayGroupChannel(GroupId(it.groupId(), relay)).updateSupportedRoles(it) } + latest?.let { getOrCreateRelayGroupChannel(GroupId(it.groupId(), relay)).updateGroupRoles(it) } } return new } @@ -2712,18 +2712,18 @@ open class EventCache : if (cachedInfo != null) { val result = - LnZapReceiptValidator.validate( + ZapReceiptValidator.validate( receipt = event, expectedNostrPubkey = cachedInfo.nostrPubkey, expectedLnurl = recipientLnurl, ) - if (result is LnZapReceiptValidator.Result.Invalid && - result.reason != LnZapReceiptValidator.Result.Reason.MISMATCHED_LNURL + if (result is ZapReceiptValidator.Result.Invalid && + result.reason != ZapReceiptValidator.Result.Reason.MISMATCHED_LNURL ) { Log.w("ZP") { "dropping zap receipt ${event.id}: ${result.reason} ${result.detail ?: ""}" } return false } - if (result is LnZapReceiptValidator.Result.Invalid) { + if (result is ZapReceiptValidator.Result.Invalid) { Log.w("ZP") { "zap receipt ${event.id} has mismatched lnurl tag (accepting per SHOULD)" } } @@ -2759,18 +2759,18 @@ open class EventCache : return@launch } val result = - LnZapReceiptValidator.validate( + ZapReceiptValidator.validate( receipt = event, expectedNostrPubkey = info.nostrPubkey, expectedLnurl = recipientLnurl, ) - if (result is LnZapReceiptValidator.Result.Invalid && - result.reason != LnZapReceiptValidator.Result.Reason.MISMATCHED_LNURL + if (result is ZapReceiptValidator.Result.Invalid && + result.reason != ZapReceiptValidator.Result.Reason.MISMATCHED_LNURL ) { Log.w("ZP") { "dropping zap receipt ${event.id}: ${result.reason} ${result.detail ?: ""}" } return@launch } - if (result is LnZapReceiptValidator.Result.Invalid) { + if (result is ZapReceiptValidator.Result.Invalid) { Log.w("ZP") { "zap receipt ${event.id} has mismatched lnurl tag (accepting per SHOULD)" } } repliesTo.forEach { it.addZap(zapRequest, note) } diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip28PublicChats/PublicChatListState.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip28PublicChats/PublicChatListState.kt index 1f70bcea4b..da9e804fcb 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip28PublicChats/PublicChatListState.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip28PublicChats/PublicChatListState.kt @@ -44,9 +44,9 @@ import kotlinx.coroutines.flow.transformLatest import kotlinx.coroutines.launch interface PublicChatListRepository { - fun channelList(): PublicChatListEvent? + fun publicChatList(): PublicChatListEvent? - fun updateChannelListTo(newChannelList: PublicChatListEvent?) + fun updatePublicChatListTo(newPublicChatList: PublicChatListEvent?) } class PublicChatListState( @@ -57,22 +57,22 @@ class PublicChatListState( val settings: PublicChatListRepository, ) { // Creates a long-term reference for this note so that the GC doesn't collect the note it self - val publicChatListNote = cache.getOrCreateAddressableNote(getChannelListAddress()) + val publicChatListNote = cache.getOrCreateAddressableNote(getPublicChatListAddress()) - fun getChannelListAddress() = PublicChatListEvent.createAddress(signer.pubKey) + fun getPublicChatListAddress() = PublicChatListEvent.createAddress(signer.pubKey) - fun getChannelListFlow(): StateFlow = publicChatListNote.flow().metadata.stateFlow + fun getPublicChatListFlow(): StateFlow = publicChatListNote.flow().metadata.stateFlow - fun getChannelList(): PublicChatListEvent? = publicChatListNote.event as? PublicChatListEvent + fun getPublicChatList(): PublicChatListEvent? = publicChatListNote.event as? PublicChatListEvent suspend fun publicChatListWithBackup(note: Note): Set { - val event = note.event as? PublicChatListEvent ?: settings.channelList() + val event = note.event as? PublicChatListEvent ?: settings.publicChatList() return event?.let { decryptionCache.channelSet(it) } ?: emptySet() } @OptIn(ExperimentalCoroutinesApi::class) val flow: StateFlow> = - getChannelListFlow() + getPublicChatListFlow() .transformLatest { noteState -> emit(publicChatListWithBackup(noteState.note)) }.onStart { @@ -112,7 +112,7 @@ class PublicChatListState( ) suspend fun follow(channel: PublicChatChannel): PublicChatListEvent { - val publicChatList = getChannelList() + val publicChatList = getPublicChatList() return if (publicChatList == null) { PublicChatListEvent.create(ChannelTag(channel.idHex, channel.relayHintUrl()), true, signer) @@ -122,7 +122,7 @@ class PublicChatListState( } suspend fun follow(channels: List): PublicChatListEvent { - val publicChatList = getChannelList() + val publicChatList = getPublicChatList() val channelTags = channels.map { ChannelTag(it.idHex, it.relayHintUrl()) } return if (publicChatList == null) { @@ -133,7 +133,7 @@ class PublicChatListState( } suspend fun unfollow(channel: PublicChatChannel): PublicChatListEvent? { - val publicChatList = getChannelList() + val publicChatList = getPublicChatList() return if (publicChatList != null) { PublicChatListEvent.remove(publicChatList, ChannelTag(channel.idHex, channel.relayHintUrl()), signer) @@ -143,7 +143,7 @@ class PublicChatListState( } init { - settings.channelList()?.let { event -> + settings.publicChatList()?.let { event -> Log.d("AccountRegisterObservers") { "Loading saved channel list ${event.toJson()}" } @OptIn(DelicateCoroutinesApi::class) scope.launch(Dispatchers.IO) { @@ -153,10 +153,10 @@ class PublicChatListState( scope.launch(Dispatchers.IO) { Log.d("AccountRegisterObservers", "Channel List Collector Start") - getChannelListFlow().collect { + getPublicChatListFlow().collect { Log.d("AccountRegisterObservers") { "Channel List for ${signer.pubKey}" } (it.note.event as? PublicChatListEvent)?.let { - settings.updateChannelListTo(it) + settings.updatePublicChatListTo(it) } } } diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip29RelayGroups/RelayGroupChannel.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip29RelayGroups/RelayGroupChannel.kt index d1009af4cc..7849dfd3d0 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip29RelayGroups/RelayGroupChannel.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip29RelayGroups/RelayGroupChannel.kt @@ -109,9 +109,9 @@ class RelayGroupChannel( * the role names a moderation UI should offer when assigning a role, since the exact * set is relay-defined (NIP-29 §Group management). */ - var supportedRoles: List = emptyList() + var groupRoles: List = emptyList() private set - private var supportedRolesUpdatedAt: Long = 0 + private var groupRolesUpdatedAt: Long = 0 /** * Members ∪ admins, recomputed only when a roster event lands. [memberCount] and the discovery @@ -164,7 +164,7 @@ class RelayGroupChannel( event != null || members.isNotEmpty() || admins.isNotEmpty() || - supportedRoles.isNotEmpty() || + groupRoles.isNotEmpty() || pinnedEventIds.isNotEmpty() /** A relay group lives on exactly one relay: its host. */ @@ -237,11 +237,11 @@ class RelayGroupChannel( updateChannelInfo() } - fun updateSupportedRoles(event: GroupRolesEvent) { + fun updateGroupRoles(event: GroupRolesEvent) { // Only newer definitions supersede; equal-or-older is dropped (no redundant emit). - if (event.createdAt <= supportedRolesUpdatedAt) return - supportedRoles = event.roles() - supportedRolesUpdatedAt = event.createdAt + if (event.createdAt <= groupRolesUpdatedAt) return + groupRoles = event.roles() + groupRolesUpdatedAt = event.createdAt updateChannelInfo() } diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip30CustomEmojis/EmojiPackState.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip30CustomEmojis/EmojiPackState.kt index 612e2c5673..eea948a198 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip30CustomEmojis/EmojiPackState.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip30CustomEmojis/EmojiPackState.kt @@ -53,13 +53,13 @@ class EmojiPackState( ) // Creates a long-term reference for this note so that the GC doesn't collect the note it self - val emojiPackListNote = cache.getOrCreateAddressableNote(getEmojiPackSelectionAddress()) + val emojiPackListNote = cache.getOrCreateAddressableNote(getEmojiListAddress()) - fun getEmojiPackSelectionAddress() = EmojiListEvent.createAddress(signer.pubKey) + fun getEmojiListAddress() = EmojiListEvent.createAddress(signer.pubKey) - fun getEmojiPackSelection(): EmojiListEvent? = emojiPackListNote.event as? EmojiListEvent + fun getEmojiList(): EmojiListEvent? = emojiPackListNote.event as? EmojiListEvent - fun getEmojiPackSelectionFlow(): StateFlow = emojiPackListNote.flow().metadata.stateFlow + fun getEmojiListFlow(): StateFlow = emojiPackListNote.flow().metadata.stateFlow fun convertEmojiSelectionPack(selection: EmojiListEvent?): List>? = selection?.taggedAddresses()?.map { @@ -71,11 +71,11 @@ class EmojiPackState( @OptIn(ExperimentalCoroutinesApi::class) val flow: StateFlow>?> = - getEmojiPackSelectionFlow() + getEmojiListFlow() .transformLatest { emit(convertEmojiSelectionPack(it.note.event as? EmojiListEvent)) }.onStart { - emit(convertEmojiSelectionPack(getEmojiPackSelection())) + emit(convertEmojiSelectionPack(getEmojiList())) }.flowOn(Dispatchers.IO) .stateIn( scope, @@ -115,7 +115,7 @@ class EmojiPackState( emit( mergePackWithPrivate( convertEmojiSelectionPack( - getEmojiPackSelection(), + getEmojiList(), )?.map { it.value }?.toTypedArray() ?: emptyArray(), ), ) @@ -149,7 +149,7 @@ class EmojiPackState( val eventHint = emojiPack.toEventHint() ?: throw IllegalArgumentException("Cannot build event hint for this emoji pack.") - val usersEmojiList = getEmojiPackSelection() + val usersEmojiList = getEmojiList() return if (usersEmojiList == null) { val template = EmojiListEvent.build(listOf(eventHint)) signer.sign(template) @@ -160,7 +160,7 @@ class EmojiPackState( } suspend fun removeEmojiPack(emojiPack: Note): EmojiListEvent? { - val usersEmojiList = getEmojiPackSelection() ?: throw IllegalArgumentException("No emoji pack selection exists to remove from.") + val usersEmojiList = getEmojiList() ?: throw IllegalArgumentException("No emoji pack selection exists to remove from.") val emojiPackEvent = emojiPack.event if (emojiPackEvent !is EmojiPackEvent) return null diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/blockPeopleList/BlockPeopleListState.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/blockPeopleList/BlockPeopleListState.kt index 0d36cb6391..e0c991c18a 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/blockPeopleList/BlockPeopleListState.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/blockPeopleList/BlockPeopleListState.kt @@ -23,12 +23,12 @@ package com.vitorpamplona.amethyst.commons.model.nip51Lists.blockPeopleList import com.vitorpamplona.amethyst.commons.model.Note import com.vitorpamplona.amethyst.commons.model.NoteState import com.vitorpamplona.amethyst.commons.model.cache.LocalCache -import com.vitorpamplona.amethyst.commons.model.nip51Lists.peopleList.PeopleListDecryptionCache +import com.vitorpamplona.amethyst.commons.model.nip51Lists.followSets.FollowSetDecryptionCache import com.vitorpamplona.quartz.nip01Core.signers.NostrSigner +import com.vitorpamplona.quartz.nip51Lists.followSet.FollowSetEvent import com.vitorpamplona.quartz.nip51Lists.muteList.tags.MuteTag import com.vitorpamplona.quartz.nip51Lists.muteList.tags.UserTag import com.vitorpamplona.quartz.nip51Lists.muteList.tags.WordTag -import com.vitorpamplona.quartz.nip51Lists.peopleList.FollowSetEvent import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.IO @@ -42,7 +42,7 @@ import kotlinx.coroutines.flow.stateIn class BlockPeopleListState( val signer: NostrSigner, val cache: LocalCache, - val decryptionCache: PeopleListDecryptionCache, + val decryptionCache: FollowSetDecryptionCache, val scope: CoroutineScope, ) { // Creates a long-term reference for this note so that the GC doesn't collect the note it self diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/labeledBookmarkLists/LabeledBookmarkList.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/bookmarkSets/BookmarkSet.kt similarity index 94% rename from commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/labeledBookmarkLists/LabeledBookmarkList.kt rename to commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/bookmarkSets/BookmarkSet.kt index a3e8e03d70..3187738854 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/labeledBookmarkLists/LabeledBookmarkList.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/bookmarkSets/BookmarkSet.kt @@ -18,7 +18,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.amethyst.commons.model.nip51Lists.labeledBookmarkLists +package com.vitorpamplona.amethyst.commons.model.nip51Lists.bookmarkSets import androidx.compose.runtime.Stable import com.vitorpamplona.quartz.nip51Lists.bookmarkList.tags.AddressBookmark @@ -26,7 +26,7 @@ import com.vitorpamplona.quartz.nip51Lists.bookmarkList.tags.BookmarkIdTag import com.vitorpamplona.quartz.nip51Lists.bookmarkList.tags.EventBookmark @Stable -data class LabeledBookmarkList( +data class BookmarkSet( val identifier: String, val title: String, val description: String?, diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/relayFeeds/RelayFeedsListDecryptionCache.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/favoriteRelays/FavoriteRelayListDecryptionCache.kt similarity index 92% rename from commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/relayFeeds/RelayFeedsListDecryptionCache.kt rename to commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/favoriteRelays/FavoriteRelayListDecryptionCache.kt index 694897a993..65f7dc608e 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/relayFeeds/RelayFeedsListDecryptionCache.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/favoriteRelays/FavoriteRelayListDecryptionCache.kt @@ -18,12 +18,12 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.amethyst.commons.model.nip51Lists.relayFeeds +package com.vitorpamplona.amethyst.commons.model.nip51Lists.favoriteRelays import com.vitorpamplona.amethyst.commons.model.nip51Lists.relayLists.GenericRelayListCache import com.vitorpamplona.quartz.nip01Core.signers.NostrSigner import com.vitorpamplona.quartz.nip51Lists.relayLists.FavoriteRelayListEvent -class RelayFeedsListDecryptionCache( +class FavoriteRelayListDecryptionCache( signer: NostrSigner, ) : GenericRelayListCache(signer) diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/peopleList/PeopleListDecryptionCache.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/followSets/FollowSetDecryptionCache.kt similarity index 94% rename from commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/peopleList/PeopleListDecryptionCache.kt rename to commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/followSets/FollowSetDecryptionCache.kt index e31ca57983..b53e2a351b 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/peopleList/PeopleListDecryptionCache.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/followSets/FollowSetDecryptionCache.kt @@ -18,18 +18,18 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.amethyst.commons.model.nip51Lists.peopleList +package com.vitorpamplona.amethyst.commons.model.nip51Lists.followSets import com.vitorpamplona.quartz.nip01Core.signers.NostrSigner import com.vitorpamplona.quartz.nip51Lists.PrivateTagArrayEventCache +import com.vitorpamplona.quartz.nip51Lists.followSet.FollowSetEvent import com.vitorpamplona.quartz.nip51Lists.muteList.mutedUserIdSet import com.vitorpamplona.quartz.nip51Lists.muteList.mutedUsers import com.vitorpamplona.quartz.nip51Lists.muteList.mutedUsersAndWords import com.vitorpamplona.quartz.nip51Lists.muteList.mutedWordSet import com.vitorpamplona.quartz.nip51Lists.muteList.mutedWords -import com.vitorpamplona.quartz.nip51Lists.peopleList.FollowSetEvent -class PeopleListDecryptionCache( +class FollowSetDecryptionCache( val signer: NostrSigner, ) { val cachedPrivateLists = PrivateTagArrayEventCache(signer) diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/peopleList/PeopleList.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/followSets/PeopleList.kt similarity index 96% rename from commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/peopleList/PeopleList.kt rename to commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/followSets/PeopleList.kt index d0366e3dd9..8e412478c5 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/peopleList/PeopleList.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/followSets/PeopleList.kt @@ -18,7 +18,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.amethyst.commons.model.nip51Lists.peopleList +package com.vitorpamplona.amethyst.commons.model.nip51Lists.followSets import androidx.compose.runtime.Stable import com.vitorpamplona.amethyst.commons.model.User diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/hashtagLists/HashtagListDecryptionCache.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/interestLists/InterestListDecryptionCache.kt similarity index 86% rename from commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/hashtagLists/HashtagListDecryptionCache.kt rename to commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/interestLists/InterestListDecryptionCache.kt index db80d69a1b..2fcd45b9c0 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/hashtagLists/HashtagListDecryptionCache.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip51Lists/interestLists/InterestListDecryptionCache.kt @@ -18,14 +18,14 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.amethyst.commons.model.nip51Lists.hashtagLists +package com.vitorpamplona.amethyst.commons.model.nip51Lists.interestLists import com.vitorpamplona.quartz.nip01Core.signers.NostrSigner import com.vitorpamplona.quartz.nip51Lists.PrivateTagArrayEventCache -import com.vitorpamplona.quartz.nip51Lists.hashtagList.InterestListEvent -import com.vitorpamplona.quartz.nip51Lists.hashtagList.hashtagSet +import com.vitorpamplona.quartz.nip51Lists.interestList.InterestListEvent +import com.vitorpamplona.quartz.nip51Lists.interestList.hashtagSet -class HashtagListDecryptionCache( +class InterestListDecryptionCache( val signer: NostrSigner, ) { val cachedPrivateLists = PrivateTagArrayEventCache(signer) diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip85TrustedAssertions/ContactCardDecryptionCache.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip85TrustedAssertions/UserAssertionDecryptionCache.kt similarity index 98% rename from commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip85TrustedAssertions/ContactCardDecryptionCache.kt rename to commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip85TrustedAssertions/UserAssertionDecryptionCache.kt index 61bb8a3705..7fd54fb060 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip85TrustedAssertions/ContactCardDecryptionCache.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip85TrustedAssertions/UserAssertionDecryptionCache.kt @@ -34,7 +34,7 @@ import com.vitorpamplona.quartz.nip85TrustedAssertions.users.summary * reading them requires the account's main key ([signer]); cards signed by any * other key never decrypt here. */ -class ContactCardDecryptionCache( +class UserAssertionDecryptionCache( val signer: NostrSigner, ) { val cachedPrivateCards = PrivateTagArrayEventCache(signer, cacheSize = 100) diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip85TrustedAssertions/ContactCardsState.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip85TrustedAssertions/UserAssertionsState.kt similarity index 98% rename from commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip85TrustedAssertions/ContactCardsState.kt rename to commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip85TrustedAssertions/UserAssertionsState.kt index ce8635472b..1837e2334c 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip85TrustedAssertions/ContactCardsState.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/nip85TrustedAssertions/UserAssertionsState.kt @@ -51,10 +51,10 @@ import kotlinx.coroutines.flow.mapLatest * account itself ([signer]'s pubkey). */ @Stable -class ContactCardsState( +class UserAssertionsState( val signer: NostrSigner, val cache: ICacheProvider, - val decryptionCache: ContactCardDecryptionCache, + val decryptionCache: UserAssertionDecryptionCache, val emojiPacks: EmojiPackState, ) { private val accountUser: User? by lazy { cache.getOrCreateUser(signer.pubKey) } diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/topNavFeeds/FeedDecryptionCaches.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/topNavFeeds/FeedDecryptionCaches.kt index 2df60e89d5..ce85cb0878 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/topNavFeeds/FeedDecryptionCaches.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/topNavFeeds/FeedDecryptionCaches.kt @@ -20,16 +20,16 @@ */ package com.vitorpamplona.amethyst.commons.model.topNavFeeds +import com.vitorpamplona.amethyst.commons.model.nip51Lists.followSets.FollowSetDecryptionCache import com.vitorpamplona.amethyst.commons.model.nip51Lists.geohashLists.GeohashListDecryptionCache -import com.vitorpamplona.amethyst.commons.model.nip51Lists.hashtagLists.HashtagListDecryptionCache +import com.vitorpamplona.amethyst.commons.model.nip51Lists.interestLists.InterestListDecryptionCache import com.vitorpamplona.amethyst.commons.model.nip51Lists.muteList.MuteListDecryptionCache -import com.vitorpamplona.amethyst.commons.model.nip51Lists.peopleList.PeopleListDecryptionCache import com.vitorpamplona.amethyst.commons.model.nip72Communities.CommunityListDecryptionCache class FeedDecryptionCaches( - val peopleListCache: PeopleListDecryptionCache, + val peopleListCache: FollowSetDecryptionCache, val muteListCache: MuteListDecryptionCache, val communityListCache: CommunityListDecryptionCache, - val hashtagCache: HashtagListDecryptionCache, + val hashtagCache: InterestListDecryptionCache, val geohashCache: GeohashListDecryptionCache, ) diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/topNavFeeds/noteBased/NoteFeedFlow.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/topNavFeeds/noteBased/NoteFeedFlow.kt index d48e5704a0..bf9b8604aa 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/topNavFeeds/noteBased/NoteFeedFlow.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/topNavFeeds/noteBased/NoteFeedFlow.kt @@ -35,11 +35,11 @@ import com.vitorpamplona.amethyst.commons.model.topNavFeeds.noteBased.muted.Mute import com.vitorpamplona.quartz.nip01Core.core.Event import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl import com.vitorpamplona.quartz.nip01Core.signers.NostrSigner -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.followSet.FollowSetEvent import com.vitorpamplona.quartz.nip51Lists.geohashList.GeohashListEvent -import com.vitorpamplona.quartz.nip51Lists.hashtagList.InterestListEvent +import com.vitorpamplona.quartz.nip51Lists.interestList.InterestListEvent import com.vitorpamplona.quartz.nip51Lists.muteList.MuteListEvent -import com.vitorpamplona.quartz.nip51Lists.peopleList.FollowSetEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import com.vitorpamplona.quartz.nip72ModCommunities.definition.CommunityDefinitionEvent import com.vitorpamplona.quartz.nip72ModCommunities.follow.CommunityListEvent import kotlinx.coroutines.ExperimentalCoroutinesApi diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/moderation/notifications/NotificationKinds.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/moderation/notifications/NotificationKinds.kt index 1147d8eeaf..2c582e00c6 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/moderation/notifications/NotificationKinds.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/moderation/notifications/NotificationKinds.kt @@ -111,7 +111,7 @@ object NotificationKinds { myPubKeyHex: HexKey, isTargetAuthoredByMe: (targetNoteId: HexKey) -> Boolean = { false }, ): Boolean { - // Own events never notify — except zap receipts (LnZap/Nutzap/Onchain) + // Own events never notify — except zap receipts (ZapReceipt/Nutzap/Onchain) // which are signed by the LNURL provider or the payer, not by us. if (event.pubKey == myPubKeyHex && event !is ZapReceiptEvent && diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/account/metadata/FilterBasicAccountInfoFromKeys.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/account/metadata/FilterBasicAccountInfoFromKeys.kt index 6026a0bba8..e03dbe41b1 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/account/metadata/FilterBasicAccountInfoFromKeys.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/account/metadata/FilterBasicAccountInfoFromKeys.kt @@ -31,7 +31,7 @@ import com.vitorpamplona.quartz.nip02FollowList.ContactListEvent import com.vitorpamplona.quartz.nip17Dm.settings.DmRelayListEvent import com.vitorpamplona.quartz.nip50Search.SearchRelayListEvent import com.vitorpamplona.quartz.nip51Lists.geohashList.GeohashListEvent -import com.vitorpamplona.quartz.nip51Lists.hashtagList.InterestListEvent +import com.vitorpamplona.quartz.nip51Lists.interestList.InterestListEvent import com.vitorpamplona.quartz.nip51Lists.interestSet.InterestSetEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.BlockedRelayListEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.BroadcastRelayListEvent diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/account/metadata/FilterBookmarksAndReportsFromKey.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/account/metadata/FilterBookmarksAndReportsFromKey.kt index 5d4a10c7a8..8b78c54e1c 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/account/metadata/FilterBookmarksAndReportsFromKey.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/account/metadata/FilterBookmarksAndReportsFromKey.kt @@ -28,7 +28,7 @@ import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl import com.vitorpamplona.quartz.nip51Lists.PinListEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.BookmarkListEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.OldBookmarkListEvent -import com.vitorpamplona.quartz.nip51Lists.labeledBookmarkList.BookmarkSetEvent +import com.vitorpamplona.quartz.nip51Lists.bookmarkSet.BookmarkSetEvent import com.vitorpamplona.quartz.nip56Reports.ReportEvent import com.vitorpamplona.quartz.nip62RequestToVanish.RequestToVanishEvent diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/account/metadata/FilterFollowsAndMutesFromKey.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/account/metadata/FilterFollowsAndMutesFromKey.kt index fc0436f6a0..ce5bfa014e 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/account/metadata/FilterFollowsAndMutesFromKey.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/account/metadata/FilterFollowsAndMutesFromKey.kt @@ -28,9 +28,9 @@ import com.vitorpamplona.quartz.nip01Core.relay.client.pool.RelayBasedFilter import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl import com.vitorpamplona.quartz.nip28PublicChat.list.PublicChatListEvent import com.vitorpamplona.quartz.nip30CustomEmoji.selection.EmojiListEvent -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.followSet.FollowSetEvent import com.vitorpamplona.quartz.nip51Lists.muteList.MuteListEvent -import com.vitorpamplona.quartz.nip51Lists.peopleList.FollowSetEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import com.vitorpamplona.quartz.nip58Badges.accepted.AcceptedBadgeSetEvent import com.vitorpamplona.quartz.nip58Badges.profile.ProfileBadgesEvent diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/assemblers/ContactCardFilters.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/assemblers/ContactCardFilters.kt index 237c08b2f9..837719a7ef 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/assemblers/ContactCardFilters.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/assemblers/ContactCardFilters.kt @@ -28,14 +28,14 @@ import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl import com.vitorpamplona.quartz.nip01Core.tags.dTag.DTag import com.vitorpamplona.quartz.nip85TrustedAssertions.users.UserAssertionEvent -val ContactCardKindList = listOf(UserAssertionEvent.KIND) +val UserAssertionKindList = listOf(UserAssertionEvent.KIND) /** * Kind:30382 cards *about* [targets], written by [trustedAccounts] (the account * itself plus its WoT trust providers). Fetches nicknames and scores for the * users currently on screen. */ -fun filterContactCardsToTargetKeysFromTrustedAccountsInTheRelay( +fun filterUserAssertionsToTargetKeysFromTrustedAccountsInTheRelay( targets: Set, trustedAccounts: List, relay: NormalizedRelayUrl, @@ -49,7 +49,7 @@ fun filterContactCardsToTargetKeysFromTrustedAccountsInTheRelay( ExplainedFilter( purpose = SubPurpose.PROFILE_METADATA, accountPubKeys = listOfNotNull(accountPubKey), - kinds = ContactCardKindList, + kinds = UserAssertionKindList, authors = trustedAccounts, // kind:30382 addresses the target user in the d-tag tags = mapOf(DTag.TAG_NAME to targets.sorted()), @@ -68,7 +68,7 @@ fun filterContactCardsToTargetKeysFromTrustedAccountsInTheRelay( * "Observing Profiles" — explained as *"profiles of the people currently on screen"* — made every * logged-in account look like it was watching somebody. */ -fun filterContactCardsByAuthorInTheRelay( +fun filterUserAssertionsByAuthorInTheRelay( relay: NormalizedRelayUrl, authors: List, since: Long?, @@ -81,7 +81,7 @@ fun filterContactCardsByAuthorInTheRelay( purpose = SubPurpose.ACCOUNT_DATA, // This variant fetches the accounts' OWN contact cards, so the authors are the owners. accountPubKeys = authors, - kinds = ContactCardKindList, + kinds = UserAssertionKindList, authors = authors, limit = limit, since = since, diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/discover/nip51FollowSets/FilterFollowSetsByAllCommunities.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/discover/nip51FollowSets/FilterFollowSetsByAllCommunities.kt index 714813a311..6492b4e3ee 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/discover/nip51FollowSets/FilterFollowSetsByAllCommunities.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/discover/nip51FollowSets/FilterFollowSetsByAllCommunities.kt @@ -27,7 +27,7 @@ import com.vitorpamplona.amethyst.commons.relayClient.subscriptions.SubPurpose import com.vitorpamplona.amethyst.commons.relays.SincePerRelayMap import com.vitorpamplona.quartz.nip01Core.relay.client.pool.RelayBasedFilter import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import com.vitorpamplona.quartz.nip72ModCommunities.approval.CommunityPostApprovalEvent fun filterFollowSetsAllCommunities( diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/discover/nip51FollowSets/FilterFollowSetsByAuthors.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/discover/nip51FollowSets/FilterFollowSetsByAuthors.kt index bcb5f3d944..86ea1eb063 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/discover/nip51FollowSets/FilterFollowSetsByAuthors.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/discover/nip51FollowSets/FilterFollowSetsByAuthors.kt @@ -28,7 +28,7 @@ import com.vitorpamplona.amethyst.commons.relays.SincePerRelayMap import com.vitorpamplona.quartz.nip01Core.core.HexKey import com.vitorpamplona.quartz.nip01Core.relay.client.pool.RelayBasedFilter import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent fun filterFollowSetsAuthors( relay: NormalizedRelayUrl, diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/discover/nip51FollowSets/FilterFollowSetsByCommunity.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/discover/nip51FollowSets/FilterFollowSetsByCommunity.kt index 65483bc063..b1589dc89b 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/discover/nip51FollowSets/FilterFollowSetsByCommunity.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/discover/nip51FollowSets/FilterFollowSetsByCommunity.kt @@ -26,7 +26,7 @@ import com.vitorpamplona.amethyst.commons.relayClient.subscriptions.SubPurpose import com.vitorpamplona.amethyst.commons.relays.SincePerRelayMap import com.vitorpamplona.quartz.nip01Core.relay.client.pool.RelayBasedFilter import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import com.vitorpamplona.quartz.nip72ModCommunities.approval.CommunityPostApprovalEvent fun filterFollowSetsByCommunity( diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/discover/nip51FollowSets/FilterFollowSetsByGeohash.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/discover/nip51FollowSets/FilterFollowSetsByGeohash.kt index 8973d4358d..9b51e44710 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/discover/nip51FollowSets/FilterFollowSetsByGeohash.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/discover/nip51FollowSets/FilterFollowSetsByGeohash.kt @@ -26,7 +26,7 @@ import com.vitorpamplona.amethyst.commons.relayClient.subscriptions.SubPurpose import com.vitorpamplona.amethyst.commons.relays.SincePerRelayMap import com.vitorpamplona.quartz.nip01Core.relay.client.pool.RelayBasedFilter import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent fun filterFollowSetsByGeohash( relay: NormalizedRelayUrl, diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/discover/nip51FollowSets/FilterFollowSetsByHashtag.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/discover/nip51FollowSets/FilterFollowSetsByHashtag.kt index 21749a61e7..b228a62731 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/discover/nip51FollowSets/FilterFollowSetsByHashtag.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/discover/nip51FollowSets/FilterFollowSetsByHashtag.kt @@ -27,7 +27,7 @@ import com.vitorpamplona.amethyst.commons.relays.SincePerRelayMap import com.vitorpamplona.quartz.nip01Core.relay.client.pool.RelayBasedFilter import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl import com.vitorpamplona.quartz.nip01Core.tags.hashtags.hashtagAlts -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent fun filterFollowSetsByHashtag( relay: NormalizedRelayUrl, diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/discover/nip51FollowSets/FilterFollowSetsGlobal.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/discover/nip51FollowSets/FilterFollowSetsGlobal.kt index c62c7bf76e..b6b59bb3c4 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/discover/nip51FollowSets/FilterFollowSetsGlobal.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/discover/nip51FollowSets/FilterFollowSetsGlobal.kt @@ -25,7 +25,7 @@ import com.vitorpamplona.amethyst.commons.relayClient.subscriptions.ExplainedFil import com.vitorpamplona.amethyst.commons.relayClient.subscriptions.SubPurpose import com.vitorpamplona.amethyst.commons.relays.SincePerRelayMap import com.vitorpamplona.quartz.nip01Core.relay.client.pool.RelayBasedFilter -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent fun filterFollowSetsGlobal( relays: GlobalTopNavPerRelayFilterSet, diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/profile/FilterUserProfileLists.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/profile/FilterUserProfileLists.kt index 1ebb50c63b..444f4e1695 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/profile/FilterUserProfileLists.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/profile/FilterUserProfileLists.kt @@ -29,9 +29,9 @@ import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl import com.vitorpamplona.quartz.nip51Lists.PinListEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.BookmarkListEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.OldBookmarkListEvent -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent -import com.vitorpamplona.quartz.nip51Lists.hashtagList.InterestListEvent -import com.vitorpamplona.quartz.nip51Lists.peopleList.FollowSetEvent +import com.vitorpamplona.quartz.nip51Lists.followSet.FollowSetEvent +import com.vitorpamplona.quartz.nip51Lists.interestList.InterestListEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import com.vitorpamplona.quartz.nip89AppHandlers.recommendation.AppRecommendationEvent val UserProfileListKinds = diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/user/watchers/UserCardsSubAssembler.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/user/watchers/UserCardsSubAssembler.kt index 9c4ffbc31e..bee7470979 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/user/watchers/UserCardsSubAssembler.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/relayClient/user/watchers/UserCardsSubAssembler.kt @@ -23,7 +23,7 @@ package com.vitorpamplona.amethyst.commons.relayClient.user.watchers import com.vitorpamplona.amethyst.commons.model.User import com.vitorpamplona.amethyst.commons.model.cache.ICacheProvider import com.vitorpamplona.amethyst.commons.model.toHexSet -import com.vitorpamplona.amethyst.commons.relayClient.assemblers.filterContactCardsToTargetKeysFromTrustedAccountsInTheRelay +import com.vitorpamplona.amethyst.commons.relayClient.assemblers.filterUserAssertionsToTargetKeysFromTrustedAccountsInTheRelay import com.vitorpamplona.amethyst.commons.relayClient.eoseManagers.SingleSubEoseManager import com.vitorpamplona.amethyst.commons.relayClient.user.UserFinderQueryState import com.vitorpamplona.amethyst.commons.relays.MutableTime @@ -103,14 +103,14 @@ class UserCardsSubAssembler( val groups = groupByRelayPresence(lastUsersOnFilter, relay) val trustedAccounts = trustedUsersInThisRelay.sorted() listOfNotNull( - filterContactCardsToTargetKeysFromTrustedAccountsInTheRelay( + filterUserAssertionsToTargetKeysFromTrustedAccountsInTheRelay( accountPubKey = soleAccountPubKey, targets = groups.usersWithoutEose.toHexSet(), trustedAccounts = trustedAccounts, relay = relay, since = null, ), - filterContactCardsToTargetKeysFromTrustedAccountsInTheRelay( + filterUserAssertionsToTargetKeysFromTrustedAccountsInTheRelay( accountPubKey = soleAccountPubKey, targets = groups.usersWithEose.toHexSet(), trustedAccounts = trustedAccounts, diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/search/KindRegistry.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/search/KindRegistry.kt index 34b7ce090f..fb790f0858 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/search/KindRegistry.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/search/KindRegistry.kt @@ -32,7 +32,7 @@ import com.vitorpamplona.quartz.nip28PublicChat.admin.ChannelCreateEvent import com.vitorpamplona.quartz.nip28PublicChat.admin.ChannelMetadataEvent import com.vitorpamplona.quartz.nip30CustomEmoji.pack.EmojiPackEvent import com.vitorpamplona.quartz.nip34Git.repository.GitRepositoryEvent -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import com.vitorpamplona.quartz.nip52Calendar.appt.day.CalendarDateSlotEvent import com.vitorpamplona.quartz.nip52Calendar.appt.time.CalendarTimeSlotEvent import com.vitorpamplona.quartz.nip52Calendar.calendar.CalendarCollectionEvent diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/search/RenderableKinds.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/search/RenderableKinds.kt index 214e789056..71636dfc37 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/search/RenderableKinds.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/search/RenderableKinds.kt @@ -47,8 +47,8 @@ import com.vitorpamplona.quartz.nip34Git.repository.GitRepositoryEvent import com.vitorpamplona.quartz.nip51Lists.PinListEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.BookmarkListEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.OldBookmarkListEvent -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent -import com.vitorpamplona.quartz.nip51Lists.peopleList.FollowSetEvent +import com.vitorpamplona.quartz.nip51Lists.followSet.FollowSetEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import com.vitorpamplona.quartz.nip51Lists.videoCurationSet.VideoCurationSetEvent import com.vitorpamplona.quartz.nip52Calendar.appt.day.CalendarDateSlotEvent import com.vitorpamplona.quartz.nip52Calendar.appt.time.CalendarTimeSlotEvent diff --git a/commons/src/commonTest/kotlin/com/vitorpamplona/amethyst/commons/model/privateChats/ChatPreviewTest.kt b/commons/src/commonTest/kotlin/com/vitorpamplona/amethyst/commons/model/privateChats/ChatPreviewTest.kt index d050ab8e93..b831f2d452 100644 --- a/commons/src/commonTest/kotlin/com/vitorpamplona/amethyst/commons/model/privateChats/ChatPreviewTest.kt +++ b/commons/src/commonTest/kotlin/com/vitorpamplona/amethyst/commons/model/privateChats/ChatPreviewTest.kt @@ -37,7 +37,7 @@ class ChatPreviewTest { private val ciphertext = "0tyoSVovKSK9uDKLUVMs137TD0b+vz+fjoJN+gG3Bk4=?iv=6r6yPQ==" - private fun privateDm( + private fun encryptedDm( author: String = other, recipient: String = me, ) = EncryptedDmEvent( @@ -63,7 +63,7 @@ class ChatPreviewTest { @Test fun nip04DmCarriesCiphertext() { - assertTrue(privateDm().hasEncryptedContent()) + assertTrue(encryptedDm().hasEncryptedContent()) } @Test @@ -129,14 +129,14 @@ class ChatPreviewTest { fun decryptedDmRendersThePlaintext() { assertEquals( ChatPreview.Body("hi!"), - chatPreviewOf(privateDm(), decrypted = "hi!", myPubKey = me, canDecrypt = true), + chatPreviewOf(encryptedDm(), decrypted = "hi!", myPubKey = me, canDecrypt = true), ) } /** The regression under test: the raw base64 blob must never become the preview. */ @Test fun pendingDmNeverFallsThroughToCiphertext() { - val preview = chatPreviewOf(privateDm(), decrypted = null, myPubKey = me, canDecrypt = true) + val preview = chatPreviewOf(encryptedDm(), decrypted = null, myPubKey = me, canDecrypt = true) assertEquals(ChatPreview.Decrypting, preview) assertFalse(preview is ChatPreview.Body) @@ -146,7 +146,7 @@ class ChatPreviewTest { fun readOnlyAccountCannotEverDecrypt() { assertEquals( ChatPreview.Undecryptable, - chatPreviewOf(privateDm(), decrypted = null, myPubKey = me, canDecrypt = false), + chatPreviewOf(encryptedDm(), decrypted = null, myPubKey = me, canDecrypt = false), ) } @@ -155,7 +155,7 @@ class ChatPreviewTest { assertEquals( ChatPreview.Undecryptable, chatPreviewOf( - privateDm(author = other, recipient = stranger), + encryptedDm(author = other, recipient = stranger), decrypted = null, myPubKey = me, canDecrypt = true, @@ -168,7 +168,7 @@ class ChatPreviewTest { assertEquals( ChatPreview.Decrypting, chatPreviewOf( - privateDm(author = me, recipient = other), + encryptedDm(author = me, recipient = other), decrypted = null, myPubKey = me, canDecrypt = true, diff --git a/commons/src/commonTest/kotlin/com/vitorpamplona/amethyst/commons/moderation/notifications/NotificationKindsTest.kt b/commons/src/commonTest/kotlin/com/vitorpamplona/amethyst/commons/moderation/notifications/NotificationKindsTest.kt index f9aee77c88..e472f7c54e 100644 --- a/commons/src/commonTest/kotlin/com/vitorpamplona/amethyst/commons/moderation/notifications/NotificationKindsTest.kt +++ b/commons/src/commonTest/kotlin/com/vitorpamplona/amethyst/commons/moderation/notifications/NotificationKindsTest.kt @@ -139,7 +139,7 @@ class NotificationKindsTest { sig = someSig, ) - private fun privateDm( + private fun encryptedDm( author: String, pTag: String = me, ): EncryptedDmEvent = @@ -266,9 +266,9 @@ class NotificationKindsTest { @Test fun myOwnZapReceiptStillAccepted() { - // LnZap receipts are signed by the LNURL provider, not by us, + // ZapReceipt receipts are signed by the LNURL provider, not by us, // so `pubKey == me` never applies — but even if it did the - // helper explicitly allows LnZap/Nutzap/OnchainZap own-events. + // helper explicitly allows ZapReceipt/Nutzap/OnchainZap own-events. assertTrue(acceptsFor(zapReceipt(pTag = me))) } @@ -280,8 +280,8 @@ class NotificationKindsTest { // DMs -------------------------------------------------------------------- @Test - fun privateDmAccepted() { - assertTrue(acceptsFor(privateDm(author = alice))) + fun encryptedDmAccepted() { + assertTrue(acceptsFor(encryptedDm(author = alice))) } @Test diff --git a/commons/src/commonTest/kotlin/com/vitorpamplona/amethyst/commons/napplet/NappletBrokerTest.kt b/commons/src/commonTest/kotlin/com/vitorpamplona/amethyst/commons/napplet/NappletBrokerTest.kt index aa5d930cff..586a158653 100644 --- a/commons/src/commonTest/kotlin/com/vitorpamplona/amethyst/commons/napplet/NappletBrokerTest.kt +++ b/commons/src/commonTest/kotlin/com/vitorpamplona/amethyst/commons/napplet/NappletBrokerTest.kt @@ -42,7 +42,7 @@ import com.vitorpamplona.quartz.nip01Core.crypto.verify import com.vitorpamplona.quartz.nip01Core.relay.filters.Filter import com.vitorpamplona.quartz.nip01Core.signers.NostrSigner import com.vitorpamplona.quartz.nip01Core.signers.NostrSignerInternal -import com.vitorpamplona.quartz.nip57Zaps.LnZapPrivateEvent +import com.vitorpamplona.quartz.nip57Zaps.PrivateZapEvent import com.vitorpamplona.quartz.nip57Zaps.ZapRequestEvent import kotlinx.coroutines.CompletableDeferred import kotlinx.coroutines.async @@ -137,7 +137,7 @@ class NappletBrokerTest { fromPublicKey: HexKey, ): String = throw NotImplementedError() - override suspend fun decryptZapEvent(event: ZapRequestEvent): LnZapPrivateEvent = throw NotImplementedError() + override suspend fun decryptZapEvent(event: ZapRequestEvent): PrivateZapEvent = throw NotImplementedError() override suspend fun deriveKey(nonce: HexKey): HexKey = throw NotImplementedError() diff --git a/commons/src/commonTest/kotlin/com/vitorpamplona/amethyst/commons/onchain/OnchainZapSenderTest.kt b/commons/src/commonTest/kotlin/com/vitorpamplona/amethyst/commons/onchain/OnchainZapSenderTest.kt index d0f61a9ad3..f8937547c1 100644 --- a/commons/src/commonTest/kotlin/com/vitorpamplona/amethyst/commons/onchain/OnchainZapSenderTest.kt +++ b/commons/src/commonTest/kotlin/com/vitorpamplona/amethyst/commons/onchain/OnchainZapSenderTest.kt @@ -27,7 +27,7 @@ import com.vitorpamplona.quartz.nip01Core.core.toHexKey import com.vitorpamplona.quartz.nip01Core.crypto.KeyPair import com.vitorpamplona.quartz.nip01Core.signers.NostrSigner import com.vitorpamplona.quartz.nip01Core.signers.NostrSignerInternal -import com.vitorpamplona.quartz.nip57Zaps.LnZapPrivateEvent +import com.vitorpamplona.quartz.nip57Zaps.PrivateZapEvent import com.vitorpamplona.quartz.nip57Zaps.ZapRequestEvent import com.vitorpamplona.quartz.nipBCOnchainZaps.builder.OnchainZapBuilder import com.vitorpamplona.quartz.nipBCOnchainZaps.chain.BitcoinAddressTx @@ -228,7 +228,7 @@ class OnchainZapSenderTest { fromPublicKey: HexKey, ) = inner.nip44Decrypt(ciphertext, fromPublicKey) - override suspend fun decryptZapEvent(event: ZapRequestEvent): LnZapPrivateEvent = inner.decryptZapEvent(event) + override suspend fun decryptZapEvent(event: ZapRequestEvent): PrivateZapEvent = inner.decryptZapEvent(event) override suspend fun deriveKey(nonce: HexKey): HexKey = inner.deriveKey(nonce) diff --git a/commons/src/jvmTest/kotlin/com/vitorpamplona/amethyst/commons/viewmodels/NestViewModelTest.kt b/commons/src/jvmTest/kotlin/com/vitorpamplona/amethyst/commons/viewmodels/NestViewModelTest.kt index 5c27c8c828..afb4eba786 100644 --- a/commons/src/jvmTest/kotlin/com/vitorpamplona/amethyst/commons/viewmodels/NestViewModelTest.kt +++ b/commons/src/jvmTest/kotlin/com/vitorpamplona/amethyst/commons/viewmodels/NestViewModelTest.kt @@ -35,7 +35,7 @@ import com.vitorpamplona.nestsclient.transport.WebTransportSession import com.vitorpamplona.quartz.nip01Core.core.Event import com.vitorpamplona.quartz.nip01Core.signers.NostrSigner import com.vitorpamplona.quartz.nip53LiveActivities.chat.LiveActivitiesChatMessageEvent -import com.vitorpamplona.quartz.nip57Zaps.LnZapPrivateEvent +import com.vitorpamplona.quartz.nip57Zaps.PrivateZapEvent import com.vitorpamplona.quartz.nip57Zaps.ZapRequestEvent import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -589,7 +589,7 @@ class NestViewModelTest { fromPublicKey: String, ): String = error("not used") - override suspend fun decryptZapEvent(event: ZapRequestEvent): LnZapPrivateEvent = error("not used") + override suspend fun decryptZapEvent(event: ZapRequestEvent): PrivateZapEvent = error("not used") override suspend fun deriveKey(nonce: String): String = error("not used") diff --git a/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/nip51Lists/ui/BookmarkGroupItem.kt b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/nip51Lists/ui/BookmarkGroupItem.kt index 6d2ea0334b..cb27ce2c4a 100644 --- a/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/nip51Lists/ui/BookmarkGroupItem.kt +++ b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/nip51Lists/ui/BookmarkGroupItem.kt @@ -50,7 +50,7 @@ import androidx.compose.ui.unit.sp import com.vitorpamplona.amethyst.commons.icons.symbols.Icon import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols import com.vitorpamplona.amethyst.commons.model.nip51Lists.BookmarkType -import com.vitorpamplona.amethyst.commons.model.nip51Lists.labeledBookmarkLists.LabeledBookmarkList +import com.vitorpamplona.amethyst.commons.model.nip51Lists.bookmarkSets.BookmarkSet import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.bookmark_list_articles_btn_label import com.vitorpamplona.amethyst.commons.resources.bookmark_list_clone_btn_label @@ -85,7 +85,7 @@ import com.vitorpamplona.amethyst.commons.ui.theme.StdVertSpacer @Composable fun BookmarkGroupItem( modifier: Modifier = Modifier, - bookmarkList: LabeledBookmarkList, + bookmarkList: BookmarkSet, onClick: (bookmarkItemType: BookmarkType) -> Unit, onRename: () -> Unit, onDescriptionChange: () -> Unit, diff --git a/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/nip51Lists/ui/ListOfBookmarkGroupsFeedView.kt b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/nip51Lists/ui/ListOfBookmarkGroupsFeedView.kt index fe891a2366..d208a1694f 100644 --- a/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/nip51Lists/ui/ListOfBookmarkGroupsFeedView.kt +++ b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/nip51Lists/ui/ListOfBookmarkGroupsFeedView.kt @@ -46,7 +46,7 @@ import com.vitorpamplona.amethyst.commons.model.nip51Lists.BookmarkType import com.vitorpamplona.amethyst.commons.model.nip51Lists.GitRepositoryListState import com.vitorpamplona.amethyst.commons.model.nip51Lists.OldBookmarkListState import com.vitorpamplona.amethyst.commons.model.nip51Lists.PinListState -import com.vitorpamplona.amethyst.commons.model.nip51Lists.labeledBookmarkLists.LabeledBookmarkList +import com.vitorpamplona.amethyst.commons.model.nip51Lists.bookmarkSets.BookmarkSet import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.bookmark_list_icon_label import com.vitorpamplona.amethyst.commons.resources.bookmarks_explainer @@ -73,17 +73,17 @@ fun ListOfBookmarkGroupsFeedView( oldBookmarks: OldBookmarkListState, pinnedNotes: PinListState, repositories: GitRepositoryListState, - groupListFeedSource: StateFlow>, + groupListFeedSource: StateFlow>, openDefaultBookmarks: () -> Unit, openOldBookmarks: () -> Unit, openPinnedNotes: () -> Unit, openRepositories: () -> Unit, openPodcasts: () -> Unit, onOpenItem: (String, BookmarkType) -> Unit, - onRenameItem: (targetBookmarkGroup: LabeledBookmarkList) -> Unit, - onItemDescriptionChange: (bookmarkGroup: LabeledBookmarkList) -> Unit, - onItemClone: (bookmarkGroup: LabeledBookmarkList, customName: String?, customDesc: String?) -> Unit, - onDeleteItem: (bookmarkGroup: LabeledBookmarkList) -> Unit, + onRenameItem: (targetBookmarkGroup: BookmarkSet) -> Unit, + onItemDescriptionChange: (bookmarkGroup: BookmarkSet) -> Unit, + onItemClone: (bookmarkGroup: BookmarkSet, customName: String?, customDesc: String?) -> Unit, + onDeleteItem: (bookmarkGroup: BookmarkSet) -> Unit, listState: LazyListState = rememberLazyListState(), ) { val bookmarkGroupFeedState by groupListFeedSource.collectAsStateWithLifecycle() @@ -119,7 +119,7 @@ fun ListOfBookmarkGroupsFeedView( itemsIndexed( bookmarkGroupFeedState, - key = { _: Int, item: LabeledBookmarkList -> item.identifier }, + key = { _: Int, item: BookmarkSet -> item.identifier }, ) { _, groupItem -> BookmarkGroupItem( modifier = Modifier.fillMaxSize().animateItem(), diff --git a/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/nip51Lists/ui/PeopleListItem.kt b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/nip51Lists/ui/PeopleListItem.kt index 2cee4e8d6a..c73b4f9c9a 100644 --- a/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/nip51Lists/ui/PeopleListItem.kt +++ b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/nip51Lists/ui/PeopleListItem.kt @@ -51,7 +51,7 @@ import com.vitorpamplona.amethyst.commons.icons.symbols.Icon import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols import com.vitorpamplona.amethyst.commons.model.User import com.vitorpamplona.amethyst.commons.model.cache.LocalCache -import com.vitorpamplona.amethyst.commons.model.nip51Lists.peopleList.PeopleList +import com.vitorpamplona.amethyst.commons.model.nip51Lists.followSets.PeopleList import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.cancel import com.vitorpamplona.amethyst.commons.resources.follow_set_copy_action_btn_label diff --git a/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/nip85TrustedAssertions/ui/EditNicknameDialog.kt b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/nip85TrustedAssertions/ui/EditNicknameDialog.kt index b24c98cbb5..400f75d209 100644 --- a/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/nip85TrustedAssertions/ui/EditNicknameDialog.kt +++ b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/nip85TrustedAssertions/ui/EditNicknameDialog.kt @@ -41,7 +41,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import com.vitorpamplona.amethyst.commons.model.User import com.vitorpamplona.amethyst.commons.model.nip30CustomEmojis.EmojiSuggestionState -import com.vitorpamplona.amethyst.commons.model.nip85TrustedAssertions.ContactCardsState +import com.vitorpamplona.amethyst.commons.model.nip85TrustedAssertions.UserAssertionsState import com.vitorpamplona.amethyst.commons.nip30CustomEmojis.ui.ShowEmojiSuggestionList import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.nickname_cancel @@ -62,31 +62,31 @@ import org.jetbrains.compose.resources.stringResource * Typing `:` offers the account's NIP-30 custom emojis; the mappings for any * shortcode used are embedded (also encrypted) so the nickname renders with them. * - * Shared by every front end: the caller supplies the account's [contactCards] + * Shared by every front end: the caller supplies the account's [userAssertions] * and publishes the result in [onSave] (e.g. through its outbox relays). On * Android, compose `WatchAndLoadMyEmojiList` alongside so the emoji packs load. */ @Composable fun EditNicknameDialog( user: User, - contactCards: ContactCardsState, + userAssertions: UserAssertionsState, onSave: (petName: String?, summary: String?) -> Unit, onDismiss: () -> Unit, ) { val nickname = rememberTextFieldState() val summary = rememberTextFieldState() - val emojiSuggestions = remember(contactCards) { EmojiSuggestionState(contactCards.emojiPacks) } + val emojiSuggestions = remember(userAssertions) { EmojiSuggestionState(userAssertions.emojiPacks) } // which field the emoji autocomplete should insert into: the last one edited val emojiTarget = remember { mutableStateOf(null) } // Prefill with the card's current encrypted values, if any. Decryption can // be slow on external signers, so don't clobber anything already typed. LaunchedEffect(user) { - contactCards + userAssertions .petName(user.pubkeyHex) ?.takeIf { nickname.text.isEmpty() } ?.let { nickname.setTextAndPlaceCursorAtEnd(it) } - contactCards + userAssertions .summary(user.pubkeyHex) ?.takeIf { summary.text.isEmpty() } ?.let { summary.setTextAndPlaceCursorAtEnd(it) } diff --git a/desktopApp/plans/2026-05-12-feat-desktop-wallet-zapping-test-coverage-plan.md b/desktopApp/plans/2026-05-12-feat-desktop-wallet-zapping-test-coverage-plan.md index 13e2a9b82d..d3a4161b94 100644 --- a/desktopApp/plans/2026-05-12-feat-desktop-wallet-zapping-test-coverage-plan.md +++ b/desktopApp/plans/2026-05-12-feat-desktop-wallet-zapping-test-coverage-plan.md @@ -17,7 +17,7 @@ origin: desktopApp/plans/2026-05-12-wallet-zapping-phase1-2-plan.md 1. **mockk callback capture**: Use `slot<(Event, NormalizedRelayUrl) -> Unit>()` + `capture(slot)` to intercept relay subscription callbacks and feed simulated wallet responses 2. **GlobalScope.launch problem**: NwcPaymentHandler uses `GlobalScope.launch(Dispatchers.IO)` inside callbacks — tests need real time via `withTimeout(5.seconds)` to await (or refactor to inject scope) -3. **LnZapPaymentResponseEvent.createResponse()** exists — build real encrypted test responses with deterministic keys, no need to mock encryption +3. **NwcResponseEvent.createResponse()** exists — build real encrypted test responses with deterministic keys, no need to mock encryption 4. **runTest auto-advances virtual time** — timeout tests resolve instantly without real delays 5. **Codebase prefers anonymous objects** over mockk for complex interfaces (see RelayConnectionManagerTest) @@ -35,7 +35,7 @@ methods, wallet column state management, and zap dialog logic. | NIP-47 URI parsing | quartz | `Nip47WalletConnectTest.kt` | Complete | | NWC request serialization | quartz | `RequestTest.kt` (50+ cases) | Complete | | NWC response parsing | quartz | `ResponseTest.kt` (50+ cases) | Complete | -| NWC event encryption | quartz | `LnZapPaymentRequestEventTest.kt` | Complete | +| NWC event encryption | quartz | `NwcRequestEventTest.kt` | Complete | | Alby interop | quartz | `AlbyInteropTest.kt` (60+ cases) | Complete | | Account management | desktopApp | `AccountManager*Test.kt` (5 files) | Complete | | Cache pipeline | desktopApp | `DesktopCachePipelineTest.kt` | Complete | @@ -187,9 +187,9 @@ class NwcPaymentHandlerTest { **Challenge:** The `subscribeOnRelay` callback runs asynchronously. Tests must capture the `onEvent` lambda and invoke it with a simulated -`LnZapPaymentResponseEvent`. This requires building encrypted response +`NwcResponseEvent`. This requires building encrypted response events using the wallet's signer — similar to -`quartz/nip47WalletConnect/LnZapPaymentRequestEventTest.kt`. +`quartz/nip47WalletConnect/NwcRequestEventTest.kt`. **Alternative (simpler):** If capturing the relay callback is too complex, extract the response processing logic into a testable pure function and @@ -349,7 +349,7 @@ class NwcRpcIntegrationTest { val requestEvent = client.getBalance() // 2. Verify request is properly encrypted - assertEquals(LnZapPaymentRequestEvent.KIND, requestEvent.kind) + assertEquals(NwcRequestEvent.KIND, requestEvent.kind) assertTrue(requestEvent.content.isNotBlank()) // 3. Wallet decrypts and verifies method @@ -357,7 +357,7 @@ class NwcRpcIntegrationTest { assertIs(decryptedRequest) // 4. Wallet builds encrypted response - val responseEvent = LnZapPaymentResponseEvent.create( + val responseEvent = NwcResponseEvent.create( request = requestEvent, response = GetBalanceSuccessResponse( result = GetBalanceSuccessResponse.GetBalanceResult(balance = 125000), @@ -429,7 +429,7 @@ extraction needed). | Mocking relay callback is complex | Medium | Extract response processing into pure function, test that directly | | Compose state testing without Compose | Medium | Extract state holder class (Option A) | | `formatSats` is private | Low | Change to `internal` visibility | -| Encrypted response building may need quartz test utils | Low | Use same pattern as `LnZapPaymentRequestEventTest.kt` | +| Encrypted response building may need quartz test utils | Low | Use same pattern as `NwcRequestEventTest.kt` | ## Sources @@ -437,4 +437,4 @@ extraction needed). - NIP-47 protocol tests: `quartz/src/commonTest/.../nip47WalletConnect/` (13 files) - Test framework: kotlin.test + mockk 1.14.9 + kotlinx-coroutines-test 1.10.2 - Mock pattern: `AccountManagerBunkerLoginTest.kt` (relaxed mockk + coEvery) -- Crypto test pattern: `LnZapPaymentRequestEventTest.kt` (deterministic KeyPair) +- Crypto test pattern: `NwcRequestEventTest.kt` (deterministic KeyPair) diff --git a/desktopApp/plans/2026-07-23-feat-desktop-moderation-safety-plan.md b/desktopApp/plans/2026-07-23-feat-desktop-moderation-safety-plan.md index 62f1e5fc80..a2fc90ef6a 100644 --- a/desktopApp/plans/2026-07-23-feat-desktop-moderation-safety-plan.md +++ b/desktopApp/plans/2026-07-23-feat-desktop-moderation-safety-plan.md @@ -30,7 +30,7 @@ cruxes**, de-risking the whole feature: → Crux 2 resolved: reuse `invalidateData()`, don't invent a bus. 3. **Concrete APIs confirmed** (see Research Insights under Technical Approach): `MuteListEvent.create/add/remove(MuteTag, isPrivate, signer)` where `MuteTag ∈ - {UserTag, HashtagTag(word), EventTag(thread)}`; `PeopleListEvent.addUser/ + {UserTag, HashtagTag(word), EventTag(thread)}`; `FollowSetEvent.addUser/ removeUser` for blocks; publish via `signer.sign(template)` + `relayManager.broadcastToAll(signed)` (precedent `reactToNote`/`repostNote` in `desktopApp/.../ui/NoteActions.kt`). @@ -85,7 +85,7 @@ enforcement, reusing quartz protocol and the existing spam-collapse reveal: `isAcceptable`, so DMs get filtered for free once the predicate is real. - **Actions:** `hideUser`/`showUser`/`blockUser`/`hideWord`/`hideThread` on `DesktopIAccount` build → sign → publish an updated `MuteListEvent`/ - `PeopleListEvent`. + `FollowSetEvent`. - **Report:** `report(note|user, type, comment)` reuses quartz `ReportEvent.build` (kind 1984) + `ReportType`, published to the account's public + private outbox (match Android). New `ReportNoteDialog` ported to desktop Compose, wired into @@ -103,7 +103,7 @@ enforcement, reusing quartz protocol and the existing spam-collapse reveal: flowchart TD subgraph relays[Relays] K10000[kind 10000 MuteListEvent - encrypted] - K10001[kind 10001 PeopleListEvent - block] + K10001[kind 10001 FollowSetEvent - block] K1068[content notes, some content-warning tagged] end K10000 & K10001 --> SUB[Main.kt account subscription] @@ -130,7 +130,7 @@ flowchart TD | Report types | `ReportType` enum (SPAM/PROFANITY/IMPERSONATION/NUDITY/ILLEGAL/MALWARE/VIOLENCE/…) | `quartz/.../nip56Reports/ReportType.kt` | | CW detection | `Event.isSensitiveOrNSFW()`, `contentWarningReason()` | `quartz/.../nip36SensitiveContent/EventExt.kt` | | Hidden check | `Note.isHiddenFor(liveHiddenUsers)` (users+words+threads) | `quartz/.../Note.kt` | -| Mute/block events | `MuteListEvent` (10000), `PeopleListEvent` (10001) | `quartz/.../nip51Lists/…` | +| Mute/block events | `MuteListEvent` (10000), `FollowSetEvent` (10001) | `quartz/.../nip51Lists/…` | | Reveal primitive | `SpamCheckedNoteRender` `forceReveal` + `rememberSaveable(id)` | `desktopApp/.../ui/note/SpamCheckedNoteRender.kt` | ### Android references to port @@ -183,7 +183,7 @@ MuteListEvent.remove(earlierVersion, mute, signer) // reading private entries requires the signer: earlierVersion.privateTags(signer) // throws SignerExceptions.UnauthorizedDecryptionException on read-only // block (kind 10001) -PeopleListEvent.addUser(...) / removeUser(...) +FollowSetEvent.addUser(...) / removeUser(...) ``` MuteTag subtypes: `UserTag` (pubkey), `HashtagTag` (word), `EventTag` (thread root). Enforcement then reads these via `Note.isHiddenFor(liveHiddenUsers)`. diff --git a/desktopApp/plans/2026-07-27-feat-desktop-profile-actions-plan.md b/desktopApp/plans/2026-07-27-feat-desktop-profile-actions-plan.md index 5cdbf395ce..11e777743e 100644 --- a/desktopApp/plans/2026-07-27-feat-desktop-profile-actions-plan.md +++ b/desktopApp/plans/2026-07-27-feat-desktop-profile-actions-plan.md @@ -44,13 +44,13 @@ Open Desktop Messages for this pubkey via the existing deck-column pattern. (`ShareMenu.kt:56`) shape. No auth required; own + others. ## Action 3 — Add to follow-pack (kind 39089) — mostly REUSE -- **Picker source:** `FollowPacksState.allPacks: StateFlow>` +- **Picker source:** `FollowPacksState.allPacks: StateFlow>` (`followpacks/FollowPacksState.kt:84`) — zero-packs returns `emptyList()`. -- **Add member:** `FollowListEvent.add(earlierVersion, person = UserTag(pubKey, relayHint), signer)` - (`quartz nip51Lists/followList/FollowListEvent.kt:116`; `UserTag` from `muteList/tags/UserTag.kt:35`). +- **Add member:** `StarterPackEvent.add(earlierVersion, person = UserTag(pubKey, relayHint), signer)` + (`quartz nip51Lists/starterPack/StarterPackEvent.kt:116`; `UserTag` from `muteList/tags/UserTag.kt:35`). Publish via `relayManager.broadcastToAll(event)` + `cache.consume(event, relay, wasVerified=false)` (pattern in `FollowPackDetailScreen.kt:178-192`). -- **Thin `commons/actions/FollowPackActions.kt`** = pure builder wrapping `FollowListEvent.add` +- **Thin `commons/actions/FollowPackActions.kt`** = pure builder wrapping `StarterPackEvent.add` (returns the signed event; desktop layer publishes). No hand-rolled tag assembly. - **Zero-packs → offer "Create new pack"** (reuse `FollowPackEditor`); no dead-end modal. - **Stale-list guard:** disable until the target pack's current 39089 has loaded (`add` onto a stale @@ -58,33 +58,33 @@ Open Desktop Messages for this pubkey via the existing deck-column pattern. - **Modal caveat:** the picker must NOT use `rememberSubscription` (broken in AlertDialog); the `allPacks` StateFlow is already hoisted, so read it directly. -## Action 4 — Block (`PeopleListEvent` kind 30000, d=`mute`) +## Action 4 — Block (`FollowSetEvent` kind 30000, d=`mute`) **Much of this already exists on moderation-safety — Block is mostly wiring, mirroring mute.** > **Revision of parent's "extract to commons" default:** moderation-safety keeps the *mute* write > **inline** on `DesktopIAccount.updateMuteList` (not a commons builder). To avoid the architecture > reviewer's "two parallel patterns" smell, Block should be **inline and symmetric with mute** — NOT -> a `commons/actions/BlockActions.kt`. The quartz `PeopleListEvent.addUser` IS the shared builder; a +> a `commons/actions/BlockActions.kt`. The quartz `FollowSetEvent.addUser` IS the shared builder; a > commons wrapper adds nothing. (If a commons home is later wanted, extract mute + block *together*.) **Already present (REUSE, no changes):** -- `PeopleListEvent` (quartz `nip51Lists/peopleList/PeopleListEvent.kt`): `KIND=30000`, +- `FollowSetEvent` (quartz `nip51Lists/followSet/FollowSetEvent.kt`): `KIND=30000`, `BLOCK_LIST_D_TAG="mute"`, `createBlockAddress(pubKey)`; `addUser(earlierVersion, pubKeyHex, relayHint, isPrivate, signer)`, `removeUser(earlierVersion, pubKeyHex, isUserPrivate, signer)`, `remove/removeAll`. -- `PeopleListDecryptionCache(signer)` (commons) — `userIdSet(event)` merges public+private, +- `FollowSetDecryptionCache(signer)` (commons) — `userIdSet(event)` merges public+private, **fail-closed** (`privateTags` → null / `UnauthorizedDecryptionException` on read-only). - `DesktopHiddenUsersState` **already loads the own kind-30000 block list** - (`blockListNote = cache.getOrCreateAddressableNote(PeopleListEvent.createBlockAddress(signer.pubKey))`). + (`blockListNote = cache.getOrCreateAddressableNote(FollowSetEvent.createBlockAddress(signer.pubKey))`). - `publishAndConfirmDetailed(event, relays, timeout): Map` (quartz `NostrClientPublishExt.kt`); `DmSendTracker.sendBatch` shows the confirmed-publish + status pattern. **WIRE (new, small):** -- `DesktopHiddenUsersState.currentBlockList(): PeopleListEvent?` — mirror the existing - `currentMuteList()` (`blockListNote.event as? PeopleListEvent`). +- `DesktopHiddenUsersState.currentBlockList(): FollowSetEvent?` — mirror the existing + `currentMuteList()` (`blockListNote.event as? FollowSetEvent`). - `DesktopIAccount.blockUser(pubkeyHex)` / `unblockUser(pubkeyHex)` + private `updateBlockList(tag, isPrivate, add)` — **mirror `updateMuteList` exactly**: load - `currentBlockList()`, `PeopleListEvent.addUser/removeUser` (or `create` **only if null**), + `currentBlockList()`, `FollowSetEvent.addUser/removeUser` (or `create` **only if null**), `localCache.justConsumeMyOwnEvent(event)` (optimistic), then publish. - Publish Block via **`publishAndConfirmDetailed`** (Block is security-relevant; Desktop NIP-42 AUTH is partial so fire-and-forget `broadcastToAll` — what `publishModeration` uses for mute — risks @@ -106,7 +106,7 @@ moderation-safety already merges mute ∪ block: `DesktopHiddenUsersState.assemb ## Acceptance criteria - [ ] DM opens the correct 1:1 room (`ChatroomKey(setOf(pubkey))` + `selectRoom`); graceful when target has no inbox relays / read-only. - [ ] Share yields a valid `npub` / `nostr:` link via `toNpub()`/`toNProfile()` + `copyToClipboard`. -- [ ] Add-to-list adds to a chosen pack (39089, `FollowListEvent.add`) and persists; zero-packs offers create-new; disabled until pack loaded. +- [ ] Add-to-list adds to a chosen pack (39089, `StarterPackEvent.add`) and persists; zero-packs offers create-new; disabled until pack loaded. - [ ] Block (30000, d=`mute`) hides user across feeds/threads/replies/profile (via existing `LiveHiddenUsers`); Unblock reverses. - [ ] Block round-trip preserves prior private entries (test mirrors `MuteListEventTest.add_eventTagPreservesPriorUserAndWordTags`); disabled until `currentBlockList()` loaded; decrypt-fail is fail-closed. - [ ] Block publish confirmed via `publishAndConfirmDetailed` (not fire-and-forget); optimistic UI rolls back on total failure. @@ -117,7 +117,7 @@ moderation-safety already merges mute ∪ block: `DesktopHiddenUsersState.assemb ## Open questions 1. **Block write location:** inline on `DesktopIAccount` symmetric with mute (recommended, overrides parent's "extract to commons") — confirm, or still want a `commons/actions` home (then extract mute+block together)? 2. Fold Block into a combined "block & mute" (Android-style dialog) or keep standalone? (parent Open Q #1) — note enforcement effect is identical since `LiveHiddenUsers` already unions both. -3. Add-member to a 39089 pack: `FollowListEvent.add` inline in `FollowPackActions` builder — any existing desktop add-member path to prefer? (agent found none.) +3. Add-member to a 39089 pack: `StarterPackEvent.add` inline in `FollowPackActions` builder — any existing desktop add-member path to prefer? (agent found none.) ### Resolved by research - ✅ moderation-safety already loads the own kind-30000 list and unions mute ∪ block in `LiveHiddenUsers` — **enforcement needs no new code** (retires parent Open Q #3 / #6). @@ -127,9 +127,9 @@ moderation-safety already merges mute ∪ block: `DesktopHiddenUsersState.assemb - Parent plan. Branch `origin/feat/desktop-moderation-safety`: `DesktopIAccount.kt` (`updateMuteList`, `hideUser/showUser`, `publishModeration`, header menu ~L350-390), `DesktopHiddenUsersState.kt` (`currentMuteList`, loads block via `createBlockAddress`, `assemble()`). -- quartz `nip51Lists/peopleList/PeopleListEvent.kt` (KIND 30000, d=`mute`, `addUser/removeUser`), - commons `PeopleListDecryptionCache.kt`, commons `IAccount.kt` (`LiveHiddenUsers.isUserHidden`), +- quartz `nip51Lists/followSet/FollowSetEvent.kt` (KIND 30000, d=`mute`, `addUser/removeUser`), + commons `FollowSetDecryptionCache.kt`, commons `IAccount.kt` (`LiveHiddenUsers.isUserHidden`), quartz `NostrClientPublishExt.kt` (`publishAndConfirm`/`Detailed`), `DmSendTracker.kt`. -- Packs/DM/share: `followpacks/FollowPacksState.kt` (`allPacks`), quartz `FollowListEvent.kt` +- Packs/DM/share: `followpacks/FollowPacksState.kt` (`allPacks`), quartz `StarterPackEvent.kt` (`add`), `ChatroomKey.kt`, `ui/chats/ChatroomListState.kt` (`selectRoom`, `fetchMetadataIfNeeded`), `ShareMenu.kt` (`copyToClipboard`), `nip19Bech32/ByteArrayExt.kt` (`toNpub`/`toNProfile`). diff --git a/desktopApp/plans/2026-07-27-feat-desktop-profile-parity-plan.md b/desktopApp/plans/2026-07-27-feat-desktop-profile-parity-plan.md index cecd64ede7..f6b948a473 100644 --- a/desktopApp/plans/2026-07-27-feat-desktop-profile-parity-plan.md +++ b/desktopApp/plans/2026-07-27-feat-desktop-profile-parity-plan.md @@ -20,11 +20,11 @@ Android (`amethyst/`), for both viewing and editing. Six parallel research/review agents (codebase-grounding, architecture, security, simplicity, flow-gaps, past-learnings) verified this plan against source. Key changes folded in: -1. **CORRECTION — Block list kind was wrong.** Block is **`PeopleListEvent` kind 30000, - d-tag `"mute"`** — *not* 30382. Kind 30382 is already **NIP-85 `ContactCardEvent` +1. **CORRECTION — Block list kind was wrong.** Block is **`FollowSetEvent` kind 30000, + d-tag `"mute"`** — *not* 30382. Kind 30382 is already **NIP-85 `UserAssertionEvent` (WoT/GrapeRank)** in this codebase; using it would collide with the WoT feature. -2. **Don't hand-roll Block.** `PeopleListEvent.addUser(earlierVersion, isPrivate=true)` + - `BlockPeopleListState` + `PeopleListDecryptionCache` already exist and do a correct, +2. **Don't hand-roll Block.** `FollowSetEvent.addUser(earlierVersion, isPrivate=true)` + + `BlockPeopleListState` + `FollowSetDecryptionCache` already exist and do a correct, fail-closed decrypt→merge→encrypt round-trip. The new commons builder is a **thin adapter**; **never call `create()` on an already-existing (replaceable) list** — that silently un-blocks everyone. @@ -54,7 +54,7 @@ Phases 2 and 3 are unpacked in dedicated grounded sub-plans (Phase 1/4 need no f enforcement code, no commons extraction** (retires Open Q #3 & #6, and the "unify enforcement now" task). 2. **Block is inline, not a commons builder.** moderation-safety keeps *mute* inline on `DesktopIAccount.updateMuteList`; Block mirrors it (`blockUser/unblockUser/updateBlockList`) using - quartz `PeopleListEvent.addUser/removeUser`. This overrides the "extract Block to `commons/actions/`" + quartz `FollowSetEvent.addUser/removeUser`. This overrides the "extract Block to `commons/actions/`" line below and resolves the architecture reviewer's two-parallel-patterns smell. (`FollowPackActions` may still be a thin commons builder.) 3. **`observeEvents` is a fallback, not a requirement.** Existing Desktop tabs use a cache-scan @@ -69,7 +69,7 @@ Phases 2 and 3 are unpacked in dedicated grounded sub-plans (Phase 1/4 need no f | mute/block/report missing on Desktop | mute + report built on **unmerged** `feat/desktop-moderation-safety` (`DesktopIAccount.hideUser/showUser/report`, desktop `ReportNoteDialog`, header overflow menu, `DesktopHiddenUsersState`, feed enforcement, NIP-36 blur). **Not in this worktree** (currently on `main`). | Build on top; do NOT re-implement mute/report. **Resolve the base first** (see Base Strategy). | | Extract mute/block/report to `commons` | moderation-safety put mute/report **desktop-local** on `DesktopIAccount` | New builders (Block, Add-to-pack) → `commons/actions/` (matches `FollowActions`/`ReportAction`). Route Block's **write** through `DesktopIAccount` symmetric with `updateMuteList`. Unify **enforcement** now; extract shared `HiddenUsersState` as follow-up. | | Rich-text bio needs extraction (open Q) | `DesktopRichTextViewer` + commons `RichTextParser` already render feed cards | **Reuse as-is** (~5-line wrap). Resolved. | -| Block = NIP-51 kind **30382** | 30382 = NIP-85 `ContactCardEvent` (WoT). Block = `PeopleListEvent` **30000**, d=`mute` | **Corrected throughout.** | +| Block = NIP-51 kind **30382** | 30382 = NIP-85 `UserAssertionEvent` (WoT). Block = `FollowSetEvent` **30000**, d=`mute` | **Corrected throughout.** | ## Base & Branch Strategy @@ -107,7 +107,7 @@ Phases 1–2 (banner, bio, CLINK, tabs) **don't depend on moderation-safety** an - **DM** → open Desktop Messages for this pubkey. - **Share** (copy `npub` / `nostr:` link). - **Add to list / follow-pack** (reuse Desktop Follow Packs). -- **Block** — `PeopleListEvent` **kind 30000, d=`mute`** (encrypted), distinct from the mute list; +- **Block** — `FollowSetEvent` **kind 30000, d=`mute`** (encrypted), distinct from the mute list; + Unblock. (Reuses existing quartz builder — see Technical Approach.) - **Edit Profile:** add the missing **CLINK offer** field (`noffer1…`). @@ -159,7 +159,7 @@ Write-path template must guard `pubKeyHex == account.signer.pubKey` (self) and ` | Edit dialog (add CLINK) | `desktopApp/.../desktop/ui/profile/EditProfileScreen.kt` + commons `profile/EditProfileFields.kt` | | Follow Packs (add-to-list target) | `desktopApp/.../desktop/followpacks/` | | Desktop Messages (DM target) | `desktopApp/.../desktop/ui/chats/` (`ChatroomListState.selectRoom(build1on1(pubkey))`) | -| **Block — reuse, don't rebuild** | quartz `nip51Lists/peopleList/PeopleListEvent.kt` (`KIND=30000`, `BLOCK_LIST_D_TAG="mute"`, `addUser(earlierVersion, isPrivate=true)`); Android `blockPeopleList/BlockPeopleListState.kt`; commons `PeopleListDecryptionCache.kt` | +| **Block — reuse, don't rebuild** | quartz `nip51Lists/followSet/FollowSetEvent.kt` (`KIND=30000`, `BLOCK_LIST_D_TAG="mute"`, `addUser(earlierVersion, isPrivate=true)`); Android `blockPeopleList/BlockPeopleListState.kt`; commons `FollowSetDecryptionCache.kt` | | Zap decryption | quartz `PrivateZapCache(signer)` / `PrivateZapRequestBuilder.decryptZapEvent`; Android `UserProfileZapsViewModel` | | Commons actions (pattern) | `commons/.../actions/FollowActions.kt`, `commons/.../model/nip56Reports/ReportAction.kt` | @@ -193,7 +193,7 @@ if (!account.isWriteable()) return // read-only/watch-only: no-op, U // 2. NIP-51 lists (Block): reuse existing decrypt→merge→encrypt; NEVER create() an existing list val current = blockListState.getBlockList() // must be LOADED from relays first (see guard) -val event = PeopleListEvent.addUser(earlierVersion = current, pubKeyHex, relayHint, isPrivate = true, signer) +val event = FollowSetEvent.addUser(earlierVersion = current, pubKeyHex, relayHint, isPrivate = true, signer) // fail-closed: addUser throws UnauthorizedDecryptionException rather than dropping private entries // 3. publish. Block = security-relevant → confirm, don't fire-and-forget @@ -247,7 +247,7 @@ account.justConsumeMyOwnEvent(event) // optimistic local apply, symmetric wit - **Add to list:** `commons/actions/FollowPackActions.kt` (build/publish kind 39089) + pack-picker modal; **zero-packs → offer "Create new pack"** (no dead-end). - **Block:** thin `commons/actions/BlockActions.kt` adapter over - `PeopleListEvent.addUser(earlierVersion, isPrivate=true)`; route write through `DesktopIAccount` + `FollowSetEvent.addUser(earlierVersion, isPrivate=true)`; route write through `DesktopIAccount` symmetric with `updateMuteList`; add to header overflow menu; enforce via unified hidden-set. ### Phase 4 — Tests & manual sheet @@ -334,9 +334,9 @@ Every tab defines **loading / empty / populated**; Followers + Zaps add a fourth - `amethyst/.../profile/mutual/dal/UserProfileMutualFeedFilter.kt` ### Verified shared / quartz -- `quartz/.../nip51Lists/peopleList/PeopleListEvent.kt` (KIND 30000, d=`mute`, `addUser`) +- `quartz/.../nip51Lists/followSet/FollowSetEvent.kt` (KIND 30000, d=`mute`, `addUser`) - `amethyst/.../model/nip51Lists/blockPeopleList/BlockPeopleListState.kt` -- `commons/.../model/nip51Lists/peopleList/PeopleListDecryptionCache.kt` +- `commons/.../model/nip51Lists/followSets/FollowSetDecryptionCache.kt` - quartz `PrivateZapCache` / `PrivateZapRequestBuilder.decryptZapEvent` - `commons/.../actions/FollowActions.kt`, `commons/.../model/nip56Reports/ReportAction.kt` - `commons/.../richtext/RichTextParser.kt`, `desktopApp/.../ui/note/DesktopRichTextViewer.kt` diff --git a/desktopApp/plans/2026-07-27-feat-desktop-profile-tabs-plan.md b/desktopApp/plans/2026-07-27-feat-desktop-profile-tabs-plan.md index 583efaa3fa..c7dfd9a6bc 100644 --- a/desktopApp/plans/2026-07-27-feat-desktop-profile-tabs-plan.md +++ b/desktopApp/plans/2026-07-27-feat-desktop-profile-tabs-plan.md @@ -56,7 +56,7 @@ override val privateZapsDecryptionCache: IPrivateZapsDecryptionCache = PrivateZa lazily decrypts per event via `signer.decryptZapEvent`. Gate on `isWriteable()`; decrypt **own-profile only** (Android `UserProfileZapsViewModel:71-85`: `if (user.pubkeyHex == account.pubKey)` decrypt else fall back to `zapRequest.pubKey`). Lazy per row — a NIP-46 bunker does one round-trip -per zap. Kinds: `LnZapEvent.KIND=9735`, `OnchainZapEvent.KIND=8333`. +per zap. Kinds: `ZapReceiptEvent.KIND=9735`, `OnchainZapEvent.KIND=8333`. ## Per-tab implementation diff --git a/desktopApp/plans/2026-08-06-shared-metadata-loading-upstream-reconciliation-plan.md b/desktopApp/plans/2026-08-06-shared-metadata-loading-upstream-reconciliation-plan.md index e30caa24c7..562dca4e0b 100644 --- a/desktopApp/plans/2026-08-06-shared-metadata-loading-upstream-reconciliation-plan.md +++ b/desktopApp/plans/2026-08-06-shared-metadata-loading-upstream-reconciliation-plan.md @@ -23,7 +23,7 @@ Upstream re-architected the same subsystem but **also completed the model-sharin - `watchers/UserWatcherSubAssembler.kt` — commons `BaseEoseManager`; reads `account.indexerRelayList.flow.value`; calls `filterUserMetadataForKey(...)`. - `watchers/FilterUserMetadataForKey.kt` — emits `ExplainedFilter(PROFILE_METADATA, …)`; reads `LocalCache.relayHints.hintsForKey(...)` **statically** (the one non-injected cache ref). - `watchers/UserReportsSubAssembler.kt` — commons `SingleSubEoseManager`; reads `account.declaredFollowsPerOutboxRelay.value`, `account.userProfile().pubkeyHex`. -- `watchers/UserCardsSubAssembler.kt` — commons `SingleSubEoseManager`; reads `account.homeRelays.flow.value`, `account.trustProviderList.liveUserRankProvider`, `…liveUserFollowerCount`, `account.userProfile().pubkeyHex`; emits `filterContactCardsToTargetKeysFromTrustedAccountsInTheRelay(...)` (already in commons `assemblers/ContactCardFilters.kt`). +- `watchers/UserCardsSubAssembler.kt` — commons `SingleSubEoseManager`; reads `account.homeRelays.flow.value`, `account.trustProviderList.liveUserRankProvider`, `…liveUserFollowerCount`, `account.userProfile().pubkeyHex`; emits `filterUserAssertionsToTargetKeysFromTrustedAccountsInTheRelay(...)` (already in commons `assemblers/ContactCardFilters.kt`). ### Event side — `amethyst/.../reqCommand/event/` - `EventFinderFilterAssembler.kt` — `EventFinderQueryState(note, override val account: Account) : AccountScopedQuery`; groups `NoteEventLoaderSubAssembler`, `EventWatcherSubAssembler`, `AddressableAuthorRelayLoaderSubAssembler(cache, ::allKeys, userFinder)`. diff --git a/desktopApp/plans/archive/2026-05-09-embedded-local-relay-plan.md b/desktopApp/plans/archive/2026-05-09-embedded-local-relay-plan.md index 72cfbb3080..6d675db17a 100644 --- a/desktopApp/plans/archive/2026-05-09-embedded-local-relay-plan.md +++ b/desktopApp/plans/archive/2026-05-09-embedded-local-relay-plan.md @@ -290,7 +290,7 @@ SQLiteEventStore's `DeletionRequestModule` already handles this via BEFORE INSER - When kind 5 event inserted → trigger deletes referenced events - Trigger also prevents re-insertion of deleted events -**Desktop hook**: In `DesktopLocalCache.consume()`, when a `DeletionEvent` is consumed, the write-through to `LocalRelayStore.enqueue()` handles it — the store's trigger does the rest. +**Desktop hook**: In `DesktopLocalCache.consume()`, when a `DeletionRequestEvent` is consumed, the write-through to `LocalRelayStore.enqueue()` handles it — the store's trigger does the rest. #### Pruning Strategy Add to `LocalRelayStore`: diff --git a/desktopApp/plans/archive/2026-05-11-wallet-zapping-brainstorm.md b/desktopApp/plans/archive/2026-05-11-wallet-zapping-brainstorm.md index 102d27904e..a9435ffd03 100644 --- a/desktopApp/plans/archive/2026-05-11-wallet-zapping-brainstorm.md +++ b/desktopApp/plans/archive/2026-05-11-wallet-zapping-brainstorm.md @@ -44,7 +44,7 @@ - Biometric auth for sensitive operations ### Shared Infrastructure (Already in quartz/commons) -- **NIP-57:** `LnZapEvent`, `LnZapRequestEvent`, `LnZapPrivateEvent`, private zap encryption +- **NIP-57:** `ZapReceiptEvent`, `ZapRequestEvent`, `PrivateZapEvent`, private zap encryption - **NIP-47:** `Nip47Client`, request/response events, full RPC method set - **NIP-60:** `CashuWalletEvent`, `CashuTokenEvent`, `CashuSpendingHistoryEvent` (skeleton) - **NIP-61:** `NutzapEvent`, `NutzapInfoEvent` (skeleton) diff --git a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/cache/DesktopLocalCache.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/cache/DesktopLocalCache.kt index 39db2557dd..40736a1fa6 100644 --- a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/cache/DesktopLocalCache.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/cache/DesktopLocalCache.kt @@ -58,7 +58,7 @@ import com.vitorpamplona.quartz.nip47WalletConnect.events.NwcRequestEvent import com.vitorpamplona.quartz.nip47WalletConnect.events.NwcResponseEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.BookmarkListEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.OldBookmarkListEvent -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import com.vitorpamplona.quartz.nip53LiveActivities.chat.LiveActivitiesChatMessageEvent import com.vitorpamplona.quartz.nip53LiveActivities.streaming.LiveActivitiesEvent import com.vitorpamplona.quartz.nip57Zaps.ZapReceiptEvent @@ -331,7 +331,7 @@ class DesktopLocalCache : ICacheProvider { } is LongFormContentEvent -> { - consumeLongTextNote(event, relay) + consumeLongFormContent(event, relay) } is BookmarkListEvent -> { @@ -343,7 +343,7 @@ class DesktopLocalCache : ICacheProvider { } is StarterPackEvent -> { - consumeFollowList(event) + consumeStarterPack(event) } is CommentEvent -> { @@ -355,7 +355,7 @@ class DesktopLocalCache : ICacheProvider { } is DmRelayListEvent -> { - consumeChatMessageRelayList(event, relay) + consumeDmRelayList(event, relay) } is BlossomServersEvent -> { @@ -435,7 +435,7 @@ class DesktopLocalCache : ICacheProvider { * indexer fan-out. Mirrors [consumeAdvertisedRelayList]; emits nothing to * the event stream because the UI doesn't render kind 10050s directly. */ - private fun consumeChatMessageRelayList( + private fun consumeDmRelayList( event: DmRelayListEvent, relay: NormalizedRelayUrl?, ): Boolean { @@ -738,7 +738,7 @@ class DesktopLocalCache : ICacheProvider { * Consumes a kind 30023 long-form text note event. * Creates Note in cache like TextNoteEvent. */ - private fun consumeLongTextNote( + private fun consumeLongFormContent( event: LongFormContentEvent, relay: NormalizedRelayUrl?, ): Boolean { @@ -788,7 +788,7 @@ class DesktopLocalCache : ICacheProvider { private val _followPackVersion = MutableStateFlow(0L) val followPackVersion: StateFlow = _followPackVersion.asStateFlow() - private fun consumeFollowList(event: StarterPackEvent): Boolean { + private fun consumeStarterPack(event: StarterPackEvent): Boolean { val address = event.address() val addressableNote = getOrCreateAddressableNote(address) val author = getOrCreateUser(event.pubKey) diff --git a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/BulkFollowAction.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/BulkFollowAction.kt index 440f4aee46..662984deaf 100644 --- a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/BulkFollowAction.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/BulkFollowAction.kt @@ -25,7 +25,7 @@ import com.vitorpamplona.amethyst.desktop.cache.DesktopLocalCache import com.vitorpamplona.amethyst.desktop.model.DesktopIAccount import com.vitorpamplona.amethyst.desktop.network.RelayConnectionManager import com.vitorpamplona.quartz.nip01Core.core.HexKey -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent data class BulkFollowPreview( val totalMembers: Int, diff --git a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/FollowPackEditor.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/FollowPackEditor.kt index d08cf586f1..50ab804017 100644 --- a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/FollowPackEditor.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/FollowPackEditor.kt @@ -21,7 +21,7 @@ package com.vitorpamplona.amethyst.desktop.followpacks import com.vitorpamplona.quartz.nip01Core.core.Address -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent /** * Lightweight helpers for follow-pack viewing actions. diff --git a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/FollowPacksState.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/FollowPacksState.kt index baac2023fc..cbb0465f48 100644 --- a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/FollowPacksState.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/FollowPacksState.kt @@ -28,7 +28,7 @@ import com.vitorpamplona.quartz.nip01Core.relay.client.reqs.SubscriptionListener import com.vitorpamplona.quartz.nip01Core.relay.filters.Filter import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl import com.vitorpamplona.quartz.nip01Core.relay.normalizer.RelayUrlNormalizer -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.delay diff --git a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/ui/DiscoverScreen.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/ui/DiscoverScreen.kt index ad675bc830..fb3f820b52 100644 --- a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/ui/DiscoverScreen.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/ui/DiscoverScreen.kt @@ -71,7 +71,7 @@ import com.vitorpamplona.amethyst.desktop.model.DesktopIAccount import com.vitorpamplona.amethyst.desktop.network.RelayConnectionManager import com.vitorpamplona.amethyst.desktop.ui.ZapFeedback import com.vitorpamplona.amethyst.desktop.ui.live.LivesSection -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import kotlinx.coroutines.launch import java.awt.Toolkit import java.awt.datatransfer.StringSelection diff --git a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/ui/FollowAllConfirmDialog.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/ui/FollowAllConfirmDialog.kt index 16f8d6b122..be3285ac81 100644 --- a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/ui/FollowAllConfirmDialog.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/ui/FollowAllConfirmDialog.kt @@ -42,7 +42,7 @@ import com.vitorpamplona.amethyst.desktop.followpacks.BulkFollowAction import com.vitorpamplona.amethyst.desktop.followpacks.BulkFollowPreview import com.vitorpamplona.amethyst.desktop.model.DesktopIAccount import com.vitorpamplona.amethyst.desktop.network.RelayConnectionManager -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import kotlinx.coroutines.delay import kotlinx.coroutines.launch diff --git a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/ui/FollowPackBrowseAllScreen.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/ui/FollowPackBrowseAllScreen.kt index 4dfd5696ad..33a0c974bc 100644 --- a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/ui/FollowPackBrowseAllScreen.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/ui/FollowPackBrowseAllScreen.kt @@ -53,7 +53,7 @@ import com.vitorpamplona.amethyst.desktop.followpacks.FollowPackEditor import com.vitorpamplona.amethyst.desktop.followpacks.FollowPacksState import com.vitorpamplona.quartz.nip01Core.core.HexKey import com.vitorpamplona.quartz.nip19Bech32.decodePublicKeyAsHexOrNull -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent /** * Search-all view for follow packs. diff --git a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/ui/FollowPackComponents.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/ui/FollowPackComponents.kt index 5a0524f2ab..f684915b26 100644 --- a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/ui/FollowPackComponents.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/ui/FollowPackComponents.kt @@ -62,7 +62,7 @@ import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols import com.vitorpamplona.amethyst.commons.ui.components.UserAvatar import com.vitorpamplona.amethyst.desktop.cache.DesktopLocalCache import com.vitorpamplona.quartz.nip01Core.core.HexKey -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent /** * Stack of overlapping circular avatars for pack members. diff --git a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/ui/FollowPackDetailScreen.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/ui/FollowPackDetailScreen.kt index b7f82a76b3..f925e3ab3e 100644 --- a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/ui/FollowPackDetailScreen.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/ui/FollowPackDetailScreen.kt @@ -68,7 +68,7 @@ import com.vitorpamplona.amethyst.desktop.followpacks.subscribeMetadataFor import com.vitorpamplona.amethyst.desktop.model.DesktopIAccount import com.vitorpamplona.amethyst.desktop.network.RelayConnectionManager import com.vitorpamplona.quartz.nip01Core.core.HexKey -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import kotlinx.coroutines.launch /** diff --git a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/ui/RenderFollowPackCard.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/ui/RenderFollowPackCard.kt index 255e223ef7..1821eaf2d7 100644 --- a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/ui/RenderFollowPackCard.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/followpacks/ui/RenderFollowPackCard.kt @@ -58,7 +58,7 @@ import com.vitorpamplona.amethyst.desktop.model.DesktopIAccount import com.vitorpamplona.amethyst.desktop.network.RelayConnectionManager import com.vitorpamplona.quartz.nip01Core.core.Address import com.vitorpamplona.quartz.nip01Core.relay.filters.Filter -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import com.vitorpamplona.quartz.nip19Bech32.entities.NAddress as NAddressEntity /** diff --git a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model/DesktopHiddenUsersState.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model/DesktopHiddenUsersState.kt index b298746177..ed87d85e64 100644 --- a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model/DesktopHiddenUsersState.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/model/DesktopHiddenUsersState.kt @@ -23,11 +23,11 @@ package com.vitorpamplona.amethyst.desktop.model import com.vitorpamplona.amethyst.commons.model.LiveHiddenUsers import com.vitorpamplona.amethyst.commons.model.NoteState import com.vitorpamplona.amethyst.commons.model.cache.ICacheProvider +import com.vitorpamplona.amethyst.commons.model.nip51Lists.followSets.FollowSetDecryptionCache import com.vitorpamplona.amethyst.commons.model.nip51Lists.muteList.MuteListDecryptionCache -import com.vitorpamplona.amethyst.commons.model.nip51Lists.peopleList.PeopleListDecryptionCache import com.vitorpamplona.quartz.nip01Core.signers.NostrSigner +import com.vitorpamplona.quartz.nip51Lists.followSet.FollowSetEvent import com.vitorpamplona.quartz.nip51Lists.muteList.MuteListEvent -import com.vitorpamplona.quartz.nip51Lists.peopleList.FollowSetEvent import com.vitorpamplona.quartz.utils.DualCase import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -48,7 +48,7 @@ import kotlinx.coroutines.flow.stateIn * feeds to [com.vitorpamplona.amethyst.commons.model.Note.isHiddenFor]. * * Both lists carry a mix of public tags and an NIP-44-encrypted private section; - * the shared [MuteListDecryptionCache]/[PeopleListDecryptionCache] handle the + * the shared [MuteListDecryptionCache]/[FollowSetDecryptionCache] handle the * async decrypt (and are no-ops for read-only accounts, which simply see the * public portion). The result is exposed as a hot [StateFlow] so feeds can * re-filter live: when the list events change (or decryption resolves), a new @@ -65,7 +65,7 @@ class DesktopHiddenUsersState( private val showSensitiveContent: StateFlow = MutableStateFlow(null), ) { private val muteCache = MuteListDecryptionCache(signer) - private val blockCache = PeopleListDecryptionCache(signer) + private val blockCache = FollowSetDecryptionCache(signer) // Strong refs so the GC keeps these addressable notes (and their decrypt caches) alive. private val muteListNote = cache.getOrCreateAddressableNote(MuteListEvent.createAddress(signer.pubKey)) diff --git a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/UserProfileScreen.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/UserProfileScreen.kt index 7264e2d71b..a690bd1032 100644 --- a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/UserProfileScreen.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/UserProfileScreen.kt @@ -125,8 +125,8 @@ import com.vitorpamplona.quartz.nip39ExtIdentities.TwitterIdentity import com.vitorpamplona.quartz.nip39ExtIdentities.identityClaims import com.vitorpamplona.quartz.nip51Lists.bookmarkList.BookmarkListEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.tags.EventBookmark -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent import com.vitorpamplona.quartz.nip51Lists.muteList.tags.UserTag +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import com.vitorpamplona.quartz.nip57Zaps.ZapReceiptEvent import com.vitorpamplona.quartz.nip65RelayList.AdvertisedRelayListEvent import com.vitorpamplona.quartz.nip68Picture.PictureEvent diff --git a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/note/DesktopRichText.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/note/DesktopRichText.kt index 6c6e49ad14..257baa799b 100644 --- a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/note/DesktopRichText.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/note/DesktopRichText.kt @@ -376,7 +376,7 @@ private fun RenderBechSegment( .NAddress .parse(segment.segmentText) } - if (naddr != null && naddr.kind == com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent.KIND) { + if (naddr != null && naddr.kind == com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent.KIND) { val followPacks = com.vitorpamplona.amethyst.desktop.ui.deck.LocalFollowPacksState.current val relayManager = com.vitorpamplona.amethyst.desktop.ui.deck.LocalRelayManager.current if (localCache != null && relayManager != null && followPacks != null) { diff --git a/docs/TODO.md b/docs/TODO.md index 979b4c9996..a9711dbd38 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -5,7 +5,7 @@ **Question:** What happens when a conversation with an npub has both NIP-04 (kind 4) and NIP-17 (kind 14/15 in GiftWrap) messages? **Current behavior to investigate:** -- NIP-04 messages use `PrivateDmEvent.chatroomKey(pubKey)` → creates a `ChatroomKey` based on recipient +- NIP-04 messages use `EncryptedDmEvent.chatroomKey(pubKey)` → creates a `ChatroomKey` based on recipient - NIP-17 messages use `ChatMessageEvent.chatroomKey(pubKey)` → also creates a `ChatroomKey` based on group members - Do these produce the **same** `ChatroomKey` for 1-on-1 chats? If yes, both message types merge into one conversation. If no, they appear as separate conversations. - Android Amethyst handles this — check how `Account.kt` merges them diff --git a/docs/brainstorms/2026-03-16-desktop-media-brainstorm.md b/docs/brainstorms/2026-03-16-desktop-media-brainstorm.md index 7793b10901..e3d503140a 100644 --- a/docs/brainstorms/2026-03-16-desktop-media-brainstorm.md +++ b/docs/brainstorms/2026-03-16-desktop-media-brainstorm.md @@ -136,7 +136,7 @@ ExoPlayer is Android-only (Media3). VLCJ wraps VLC's libvlc via JNA — supports | BlossomServersEvent | `quartz/nipB7Blossom/` | Ready (kind 10063) | | BlossomUri | `quartz/nipB7Blossom/` | Ready (blossom: URI parsing) | | BlossomUploadResult | `quartz/nipB7Blossom/` | Ready | -| FileHeaderEvent (NIP-94) | `quartz/nip94FileMetadata/` | Ready (kind 1063) | +| FileMetadataEvent (NIP-94) | `quartz/nip94FileMetadata/` | Ready (kind 1063) | | BlurhashTag | `quartz/nip94FileMetadata/tags/` | Ready | | DimensionTag | `quartz/nip94FileMetadata/tags/` | Ready | | IMetaTag/Builder (NIP-92) | `quartz/nip92IMeta/` | Ready | diff --git a/docs/brainstorms/2026-03-19-dm-encryption-badge-brainstorm.md b/docs/brainstorms/2026-03-19-dm-encryption-badge-brainstorm.md index e106e509db..221f8a1500 100644 --- a/docs/brainstorms/2026-03-19-dm-encryption-badge-brainstorm.md +++ b/docs/brainstorms/2026-03-19-dm-encryption-badge-brainstorm.md @@ -24,7 +24,7 @@ Users need to know which messages are truly private (NIP-17: relay can't see sen ## Implementation The badge goes in `MessageWithReactions` in ChatPane.kt, in the `detailRow` slot of `ChatMessageCompose`. Check `note.event` type: -- `is PrivateDmEvent` → NIP-04 → lock-open gray +- `is EncryptedDmEvent` → NIP-04 → lock-open gray - `is ChatMessageEvent` or `is ChatMessageEncryptedFileHeaderEvent` → NIP-17 → lock primary - else → no badge diff --git a/docs/changelog/v0.31.04.md b/docs/changelog/v0.31.04.md index ef95bfdc15..4f28425146 100644 --- a/docs/changelog/v0.31.04.md +++ b/docs/changelog/v0.31.04.md @@ -3,7 +3,7 @@ - Login with QR by [@greenart7c3](https://github.com/greenart7c3) - Adds full nip19 parsing on key decoding capabilities by [@vitorpamplona](https://github.com/vitorpamplona) - Speeds up RichText rendering parsers by [@vitorpamplona](https://github.com/vitorpamplona) -- added message to LnZapEvent and interface by [@believethehype](https://github.com/believethehype) +- added message to ZapReceiptEvent and interface by [@believethehype](https://github.com/believethehype) - Faster processing of Contact List events by [@vitorpamplona](https://github.com/vitorpamplona) - Faster user in follow list algo by [@vitorpamplona](https://github.com/vitorpamplona) diff --git a/docs/changelog/v0.76.01.md b/docs/changelog/v0.76.01.md index 592371ba62..8e6a2a72e8 100644 --- a/docs/changelog/v0.76.01.md +++ b/docs/changelog/v0.76.01.md @@ -14,7 +14,7 @@ Adds support for Zap Split setup and payment via NWC and manually via wallet cal - Updated translations for cs/de/sv - Forces valid hexes in p- and e- tags when receiving the event - Stops accepting space as a Valid hex char and requires an even number of chars (padding) -- Forces the ZapRequest to exist when processing the LnZapEvent +- Forces the ZapRequest to exist when processing the ZapReceiptEvent - Fixes some long NIP-19 cutting off in notes - Updates to Finnish, Swedish, Czech and German translations - Adds Bengali, Bangladesh translations diff --git a/docs/changelog/v1.03.00.md b/docs/changelog/v1.03.00.md index 5b4cfbe6f7..2a2942030b 100644 --- a/docs/changelog/v1.03.00.md +++ b/docs/changelog/v1.03.00.md @@ -12,7 +12,7 @@ Improvements: - Improves the list of visible authors on live stream bubbles - Adds the error status to the URL normalizer to avoid checking it again - Adds a follow list state from kind 3 to keep following users in memory. -- Moves from RelationshipStatus to ContactCard as per NIP update +- Moves from RelationshipStatus to UserAssertion as per NIP update Fixes: - Removes crashing relay URIs with null-encoded bytes (%00) diff --git a/docs/changelog/v1.12.00.md b/docs/changelog/v1.12.00.md index efc05f16c2..f350e4e6ed 100644 --- a/docs/changelog/v1.12.00.md +++ b/docs/changelog/v1.12.00.md @@ -267,7 +267,7 @@ Highlights: - **Amethyst → commons migration (KMP/iOS).** - Moves shared, CLI-safe code out of the Android app into `commons`. - Decryption caches (Mute/People/Community, Hashtag, Favorite-algo, Trust-provider). - - Models: InterestSet, LabeledBookmarkList, NwcWalletEntry, CashuToken, OwnedEmojiPack. + - Models: InterestSet, BookmarkSet, NwcWalletEntry, CashuToken, OwnedEmojiPack. - The link-preview fetcher, relay broadcast tracker, and CLI-safe util extensions. - `HtmlParser` made KMP (dropped its Java `Charset` dependency). - A consolidated package taxonomy with a new architecture doc. diff --git a/docs/changelog/v1.12.02.md b/docs/changelog/v1.12.02.md index 3a8cb91df0..0c6e2f4b50 100644 --- a/docs/changelog/v1.12.02.md +++ b/docs/changelog/v1.12.02.md @@ -20,7 +20,7 @@ Highlights: - Adds a pausable, resumable full-text-search reindex to the SQLite and filesystem event stores, and clamps non-positive reindex batch sizes. - Indexes direct message content (NIP-17 ChatMessageEvent). -- Indexes zap comments (LnZap request/receipt, on-chain zap, and nutzap). +- Indexes zap comments (ZapReceipt request/receipt, on-chain zap, and nutzap). - Makes polls, code snippets, audio, and git/torrent replies and interest sets searchable. - Indexes parsed JSON fields of profile, channel, and app-handler events. - Indexes natural-language fields of more event kinds, and makes the remaining text-bearing events searchable. diff --git a/docs/plans/2026-06-10-feat-desktop-dm-reliability-plan.md b/docs/plans/2026-06-10-feat-desktop-dm-reliability-plan.md index 3046cbb196..9bb432f044 100644 --- a/docs/plans/2026-06-10-feat-desktop-dm-reliability-plan.md +++ b/docs/plans/2026-06-10-feat-desktop-dm-reliability-plan.md @@ -381,7 +381,7 @@ The bulk of the change lives in `quartz/.../nip01Core/relay/client/` (publish pa **Scope:** 1. **Shared `rumorCreatedAt` across recipient wraps** (R9): - - In `NIP17Factory.createWraps` (currently `quartz/.../nip17Dm/NIP17Factory.kt:43-72`), compute `rumorCreatedAt = TimeUtils.now()` once before the per-recipient `mapNotNullAsync` loop. Pass into every `SealedRumorEvent.create(...)` so all seals encode the same rumor (same `rumor.id`). + - In `NIP17Factory.createWraps` (currently `quartz/.../nip17Dm/NIP17Factory.kt:43-72`), compute `rumorCreatedAt = TimeUtils.now()` once before the per-recipient `mapNotNullAsync` loop. Pass into every `SealEvent.create(...)` so all seals encode the same rumor (same `rumor.id`). - Same `rumorId` becomes the dedupe anchor + receipt target across all recipients of a group message. 2. **Self-copy gift wrap to own DM relays** (R10): @@ -476,7 +476,7 @@ ComposeUI(send button click) → RecipientRelayFetcher.fetch([indexer relays]) → NIP17Factory.createWraps(text, recipients, signer) ── shared rumor_created_at (Phase 5) → for each recipient (parallel): - → SealedRumorEvent.create(rumor, recipient, signer) + → SealEvent.create(rumor, recipient, signer) → signer.sign(seal) (bunker round-trip if Remote) ── batch via Phase 6 capability → signer.nip44Encrypt(rumor, recipient) (bunker round-trip)── batch via Phase 6 capability → GiftWrapEvent.create(seal, recipient, ephemeralKey) diff --git a/docs/plans/archive/2026-03-18-feat-desktop-cache-navigation-persistence-plan.md b/docs/plans/archive/2026-03-18-feat-desktop-cache-navigation-persistence-plan.md index 40c4f29743..abc58a5be8 100644 --- a/docs/plans/archive/2026-03-18-feat-desktop-cache-navigation-persistence-plan.md +++ b/docs/plans/archive/2026-03-18-feat-desktop-cache-navigation-persistence-plan.md @@ -124,8 +124,8 @@ Start with 4 new event kinds (kind 9734 required for zap processing). Add remain | 0 | `MetadataEvent` | Done | Already exists (`consumeMetadata`) | | 1 | `TextNoteEvent` | 1 | Core feed content | | 7 | `ReactionEvent` | 1 | Reaction counts on Note | -| 9734 | `LnZapRequestEvent` | 1 | Required before kind 9735 can process | -| 9735 | `LnZapEvent` | 1 | Zap counts on Note | +| 9734 | `ZapRequestEvent` | 1 | Required before kind 9735 can process | +| 9735 | `ZapReceiptEvent` | 1 | Zap counts on Note | Each consume method follows Android's pattern. Use `event.tagsWithoutCitations()` for reply parsing (handles both NIP-10 marked and legacy positional tags, excluding inline nostr: citations): @@ -410,7 +410,7 @@ rememberSubscription(configuredRelays, feedMode, followedUsers, relayManager = r | UserProfileScreen | Parameterized (pubkey) | — | Uses existing kinds | | SearchResultsList | Parameterized (query) | — | Uses DesktopSearchFeedFilter | | BookmarksScreen | Singleton | 30078 (BookmarkList) | Bookmark state from events | -| ReadsScreen | Singleton | 30023 (LongTextNote) | Articles feed | +| ReadsScreen | Singleton | 30023 (LongFormContent) | Articles feed | | NotificationsScreen | Singleton | — | Uses DesktopNotificationFeedFilter | **FeedNoteCard rewrite** — done alongside FeedScreen migration (first screen). All subsequent screen migrations benefit. diff --git a/docs/plans/archive/2026-03-22-feat-clean-cache-single-source-of-truth-plan.md b/docs/plans/archive/2026-03-22-feat-clean-cache-single-source-of-truth-plan.md index efd1a1f98a..a72899608b 100644 --- a/docs/plans/archive/2026-03-22-feat-clean-cache-single-source-of-truth-plan.md +++ b/docs/plans/archive/2026-03-22-feat-clean-cache-single-source-of-truth-plan.md @@ -166,7 +166,7 @@ Four-phase migration: FeedScreen first (proves pattern), then expand cache cover ##### 1a. Expand `DesktopLocalCache.consume()` coverage -Currently handles: MetadataEvent, TextNoteEvent, ReactionEvent, LnZapRequestEvent, LnZapEvent. +Currently handles: MetadataEvent, TextNoteEvent, ReactionEvent, ZapRequestEvent, ZapReceiptEvent. **Add support for:** @@ -174,7 +174,7 @@ Currently handles: MetadataEvent, TextNoteEvent, ReactionEvent, LnZapRequestEven |------------|------|--------|-------| | `RepostEvent` | 6 | `consumeRepost()` | `Note.addBoost()` on target | | `ContactListEvent` | 3 | `consumeContactList()` | Updates `_followedUsers` StateFlow | -| `LongTextNoteEvent` | 30023 | `consumeLongTextNote()` | Creates Note like TextNote | +| `LongFormContentEvent` | 30023 | `consumeLongFormContent()` | Creates Note like TextNote | | `BookmarkListEvent` | 30001 | `consumeBookmarkList()` | Stores on `addressableNotes` or dedicated field | **File:** `desktopApp/.../cache/DesktopLocalCache.kt` @@ -461,7 +461,7 @@ when (val state = feedState) { ##### Phase 1 Acceptance Criteria -- [ ] `DesktopLocalCache.consume()` handles RepostEvent, ContactListEvent, LongTextNoteEvent, BookmarkListEvent +- [ ] `DesktopLocalCache.consume()` handles RepostEvent, ContactListEvent, LongFormContentEvent, BookmarkListEvent - [ ] consume() uses kind-based registry dispatch (not growing `when` block) - [ ] `followedUsers` is `MutableStateFlow` (not `@Volatile`) - [ ] Coordinator scope uses `SupervisorJob` + `CoroutineExceptionHandler` @@ -513,7 +513,7 @@ Apply the proven pattern from Phase 1 to all other screens. Each screen gets at ##### 2d. ReadsScreen - `DesktopFeedViewModel(DesktopReadsFeedFilter(cache), cache)` -- **Card rendering:** ReadsScreen needs `LongFormNoteCard` that extracts title/summary/topics from `Note.event as? LongTextNoteEvent`. Separate composable, not FeedNoteCard. +- **Card rendering:** ReadsScreen needs `LongFormNoteCard` that extracts title/summary/topics from `Note.event as? LongFormContentEvent`. Separate composable, not FeedNoteCard. **File:** `desktopApp/.../ui/ReadsScreen.kt` @@ -523,7 +523,7 @@ Apply the proven pattern from Phase 1 to all other screens. Each screen gets at ```kotlin fun Note.toNotificationItem(): NotificationItem? = when (event) { is ReactionEvent -> NotificationItem.Reaction(this) - is LnZapEvent -> NotificationItem.Zap(this) + is ZapReceiptEvent -> NotificationItem.Zap(this) is TextNoteEvent -> if (isReply) NotificationItem.Reply(this) else NotificationItem.Mention(this) else -> null } diff --git a/docs/plans/archive/2026-03-24-feat-article-highlights-notes-plan.md b/docs/plans/archive/2026-03-24-feat-article-highlights-notes-plan.md index 6c663793cc..64c71fbebc 100644 --- a/docs/plans/archive/2026-03-24-feat-article-highlights-notes-plan.md +++ b/docs/plans/archive/2026-03-24-feat-article-highlights-notes-plan.md @@ -286,7 +286,7 @@ Track mouse via `Modifier.pointerInput` + `awaitPointerEventScope` (pattern from object HighlightPublishAction { suspend fun publish( highlightText: String, - articleEvent: LongTextNoteEvent, + articleEvent: LongFormContentEvent, note: String?, signer: NostrSigner, ): HighlightEvent { @@ -323,8 +323,8 @@ object HighlightPublishAction { ##### NIP-09 Deletion for Published Highlights ```kotlin -suspend fun deleteHighlight(eventId: String, signer: NostrSigner): DeletionEvent { - return DeletionEvent.create( +suspend fun deleteHighlight(eventId: String, signer: NostrSigner): DeletionRequestEvent { + return DeletionRequestEvent.create( deleteEvents = listOf(eventId), deleteKinds = listOf(9802), reason = "User deleted highlight", diff --git a/docs/plans/archive/2026-04-21-feat-relay-config-parity-plan.md b/docs/plans/archive/2026-04-21-feat-relay-config-parity-plan.md index 51320c1701..4e5093464d 100644 --- a/docs/plans/archive/2026-04-21-feat-relay-config-parity-plan.md +++ b/docs/plans/archive/2026-04-21-feat-relay-config-parity-plan.md @@ -115,12 +115,12 @@ fun DmRelayEditor( - Simple relay list (no read/write split — DM relays are all-or-nothing) - Warning banner if empty: "No DM relays configured — DMs will use connected relays as fallback" -- "Save" builds `ChatMessageRelayListEvent` → sign → publish +- "Save" builds `DmRelayListEvent` → sign → publish - Security: highlight that these relays see your DM metadata **Data flow:** 1. Read current: `accountRelays.dmRelayList` StateFlow -2. Save: build `ChatMessageRelayListEvent.create(relays, signer)` → publish +2. Save: build `DmRelayListEvent.create(relays, signer)` → publish **Integration:** - Replace "DM Relays — coming soon" placeholder in `RelayConfigTab` @@ -197,7 +197,7 @@ All editors follow the same pattern — reuse `RelayListEditor` for the add/remo | Kind | Event Class | Tag Format | |------|------------|------------| | 10002 | `AdvertisedRelayListEvent` | `["r", "wss://...", "read"\|"write"]` | -| 10050 | `ChatMessageRelayListEvent` | `["relay", "wss://..."]` | +| 10050 | `DmRelayListEvent` | `["relay", "wss://..."]` | | 10007 | `SearchRelayListEvent` | `["relay", "wss://..."]` | | 10006 | `BlockedRelayListEvent` | `["relay", "wss://..."]` | @@ -214,7 +214,7 @@ All editors follow the same pattern — reuse `RelayListEditor` for the add/remo ### Phase 3b: DM Relays - [ ] DM section shows current kind 10050 relays - [ ] Warning if empty -- [ ] Save signs + publishes ChatMessageRelayListEvent +- [ ] Save signs + publishes DmRelayListEvent - [ ] Shows publish confirmation ### Phase 3c: Search Relays diff --git a/docs/plans/archive/2026-04-21-feat-relay-subscription-wiring-plan.md b/docs/plans/archive/2026-04-21-feat-relay-subscription-wiring-plan.md index 3226771755..95697cce76 100644 --- a/docs/plans/archive/2026-04-21-feat-relay-subscription-wiring-plan.md +++ b/docs/plans/archive/2026-04-21-feat-relay-subscription-wiring-plan.md @@ -144,7 +144,7 @@ val blockedRelayList: StateFlow> = _blockedRelayList.asS fun consumeIfRelevant(event: Event): Boolean { return when (event.kind) { - ChatMessageRelayListEvent.KIND -> { consumeDmRelayList(event as ChatMessageRelayListEvent); true } + DmRelayListEvent.KIND -> { consumeDmRelayList(event as DmRelayListEvent); true } SearchRelayListEvent.KIND -> { consumeSearchRelayList(event); true } BlockedRelayListEvent.KIND -> { consumeBlockedRelayList(event); true } else -> false diff --git a/docs/plans/archive/2026-04-22-feat-relay-subscription-wiring-plan.md b/docs/plans/archive/2026-04-22-feat-relay-subscription-wiring-plan.md index 497ceecb91..b69d557e79 100644 --- a/docs/plans/archive/2026-04-22-feat-relay-subscription-wiring-plan.md +++ b/docs/plans/archive/2026-04-22-feat-relay-subscription-wiring-plan.md @@ -61,10 +61,10 @@ private var lastDmCreatedAt = 0L fun consumeIfRelevant(event: Event): Boolean { return when (event.kind) { - ChatMessageRelayListEvent.KIND -> { + DmRelayListEvent.KIND -> { if (event.createdAt > lastDmCreatedAt) { lastDmCreatedAt = event.createdAt - consumeDmRelayList(event as ChatMessageRelayListEvent) + consumeDmRelayList(event as DmRelayListEvent) } true } diff --git a/docs/plans/archive/2026-04-23-feat-desktop-multi-account-support-plan.md b/docs/plans/archive/2026-04-23-feat-desktop-multi-account-support-plan.md index 43ecaa7cbd..68844ec0ae 100644 --- a/docs/plans/archive/2026-04-23-feat-desktop-multi-account-support-plan.md +++ b/docs/plans/archive/2026-04-23-feat-desktop-multi-account-support-plan.md @@ -399,7 +399,7 @@ The KMP expert found that `AccountSessionManager` and `AccountCacheState` **cann - Use `#p` tag filters (not `authors`) — listening *for* the account, not *from* it - **Exclude kind 7 reactions** — too noisy for background counts. Use NIP-45 count query at foreground activation if needed - **Include kind 6 reposts** — same filter as kind 1 mentions, relatively rare, worth tracking -- NIP-65 `readRelaysNorm()` for general notifications; kind 10050 `ChatMessageRelayListEvent` for DM-specific inbox relays +- NIP-65 `readRelaysNorm()` for general notifications; kind 10050 `DmRelayListEvent` for DM-specific inbox relays - Max 5 relay connections per inactive account (3 inbox + 2 DM) - Always set `since` field — prevents relay flooding on reconnect - Separate `RelayAuthenticator` for background connections (don't reuse active account's) diff --git a/docs/plans/archive/2026-05-04-fix-bunker-timeouts-and-decryption-plan.md b/docs/plans/archive/2026-05-04-fix-bunker-timeouts-and-decryption-plan.md index 1c6acd5ace..fbc4bc0c94 100644 --- a/docs/plans/archive/2026-05-04-fix-bunker-timeouts-and-decryption-plan.md +++ b/docs/plans/archive/2026-05-04-fix-bunker-timeouts-and-decryption-plan.md @@ -221,7 +221,7 @@ No `since` → relay reconnection replays old events. This is GOOD for our retry Current code: ```kotlin decryptedContent = when (event) { - is PrivateDmEvent -> { + is EncryptedDmEvent -> { try { event.decryptContent(account.signer) } catch (_: Exception) { @@ -245,7 +245,7 @@ if (eventContent != null) { ```kotlin decryptedContent = when (event) { - is PrivateDmEvent -> { + is EncryptedDmEvent -> { try { event.decryptContent(account.signer) } catch (_: Exception) { diff --git a/docs/plans/archive/2026-05-22-feat-desktop-note-action-bar-ux-plan.md b/docs/plans/archive/2026-05-22-feat-desktop-note-action-bar-ux-plan.md index 1ccfdf5fac..a333621aa3 100644 --- a/docs/plans/archive/2026-05-22-feat-desktop-note-action-bar-ux-plan.md +++ b/docs/plans/archive/2026-05-22-feat-desktop-note-action-bar-ux-plan.md @@ -146,7 +146,7 @@ val zapEntries = note.zaps.mapNotNull { (request, receipt) -> val sender = request.author?.toBestDisplayName() ?: request.event?.pubKey?.take(8) ?: return@mapNotNull null - val amount = (receipt?.event as? LnZapEvent)?.amount?.toLong() + val amount = (receipt?.event as? ZapReceiptEvent)?.amount?.toLong() ?: return@mapNotNull null Triple(sender, amount, request.event?.content?.ifBlank { null }) }.sortedByDescending { it.second } diff --git a/docs/plans/archive/2026-06-02-fix-desktop-feed-review-findings-plan.md b/docs/plans/archive/2026-06-02-fix-desktop-feed-review-findings-plan.md index d61e49c14a..17697b2eaa 100644 --- a/docs/plans/archive/2026-06-02-fix-desktop-feed-review-findings-plan.md +++ b/docs/plans/archive/2026-06-02-fix-desktop-feed-review-findings-plan.md @@ -39,8 +39,8 @@ Eight parallel agents resolved all 5 open questions and surfaced 3 plan revision debounce. - **Q4 — NoteActions.kt:264 formatSats:** sats, safe to swap to `amount.toZapAmount()`. Inputs are hardcoded preset amounts (line 111 - `ZAP_AMOUNTS = listOf(21L, 100L, ...)`) and `LnZapEvent.amount` which is - already sats (`LnZapEvent.kt:69`). + `ZAP_AMOUNTS = listOf(21L, 100L, ...)`) and `ZapReceiptEvent.amount` which is + already sats (`ZapReceiptEvent.kt:69`). - **Q5 — WalletColumnScreen.kt:979 formatSats:** intentional. Wallet shows precise balance with locale-aware grouping (`1,000,000`). Leave + add `// intentional` comment to prevent future drift. @@ -378,7 +378,7 @@ zapCount = if (note.zapsAmount > BigDecimal.ZERO) showAmount(note.zapsAmount) el **Edit:** `NoteActions.kt:264` — swap to `amount.toZapAmount()`. Verified sats (not msats): inputs are `ZAP_AMOUNTS = listOf(21L, 100L, 500L, 1000L, 5000L, 10000L)` -at line 111 + `LnZapEvent.amount` which is sats per `LnZapEvent.kt:69`. +at line 111 + `ZapReceiptEvent.amount` which is sats per `ZapReceiptEvent.kt:69`. **Delete the private `formatSats` fun if no remaining references** (run `grep -n formatSats desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/ui/NoteActions.kt` after swap). diff --git a/quartz/plans/2026-06-12-giftwrap-deletion-requests.md b/quartz/plans/2026-06-12-giftwrap-deletion-requests.md index d2791d65db..f392c4d991 100644 --- a/quartz/plans/2026-06-12-giftwrap-deletion-requests.md +++ b/quartz/plans/2026-06-12-giftwrap-deletion-requests.md @@ -46,7 +46,7 @@ special case describes — does nothing. `GiftWrapEvent.recipientPubKey()` at unseal time, so the validation below works after the wrap note is GC'd. -3. **Live cascade (amethyst `LocalCache.consume(DeletionEvent)`):** the +3. **Live cascade (amethyst `LocalCache.consume(DeletionRequestEvent)`):** the wrap note that knew its `innerEventId` is GC'd by the time a deletion arrives, so find the rumor by reverse lookup: scan notes for `note.rumorHost?.id == deletedId` (precedent: the addressable pass in diff --git a/quartz/plans/2026-07-11-concord-event-classes.md b/quartz/plans/2026-07-11-concord-event-classes.md index 82e57ac9a4..76b1a1ce32 100644 --- a/quartz/plans/2026-07-11-concord-event-classes.md +++ b/quartz/plans/2026-07-11-concord-event-classes.md @@ -10,7 +10,7 @@ Two problems: 1. **Duplicates standard Nostr kinds.** `ConcordKinds.MESSAGE=9`, `REACTION=7`, `DELETE=5`, `COMMENT=1111`, `EDIT=3302` shadow `ChatEvent.KIND`, - `ReactionEvent.KIND`, `DeletionEvent.KIND`, `CommentEvent.KIND`. Concord chat + `ReactionEvent.KIND`, `DeletionRequestEvent.KIND`, `CommentEvent.KIND`. Concord chat rumors *are* those standard events (they already parse back as `ChatEvent` etc. on read) — the build side should reuse the classes, not re-derive by number. @@ -37,7 +37,7 @@ binding. Introduce a binding-tag package and reuse the standard builders: | message (9) | `ChatEvent.build` | `channel` + `epoch` | | reply (9 + q) | `ChatEvent.build` + `q`/`p` | `channel` + `epoch` | | reaction (7) | `ReactionEvent.build` | `channel` + `epoch` | -| delete (5) | `DeletionEvent.build` | `channel` + `epoch` | +| delete (5) | `DeletionRequestEvent.build` | `channel` + `epoch` | `ChannelChat` keeps its public API (returns unsigned rumors via `RumorAssembler`) but builds tags from the standard event's DSL + the binding ext. Delete diff --git a/quartz/plans/archive/2026-06-09-clink.md b/quartz/plans/archive/2026-06-09-clink.md index 3529780fe0..fff712d54a 100644 --- a/quartz/plans/archive/2026-06-09-clink.md +++ b/quartz/plans/archive/2026-06-09-clink.md @@ -59,7 +59,7 @@ tags, `["e", reqId]` on responses, NIP-44 JSON content, GFY error codes | NIP-44 encrypt/decrypt | ✅ Reuse | `quartz/.../nip44Encryption/` + `signer.nip44Encrypt/Decrypt` | Use as-is | | Bech32 + TLV codec | ✅ Reuse | `nip19Bech32/bech32/`, `tlv/TlvBuilder.kt`, `tlv/Tlv.kt` | Use the codec; do NOT reuse `Nip19Parser` | | Entity TLV pattern (reference) | 📦 Mirror | `nip19Bech32/entities/NProfile.kt` | Copy shape into new Clink entities | -| Encrypted req/resp event pattern | 📦 Mirror | `nip47WalletConnect/events/LnZapPaymentRequestEvent.kt` (kind 23194) | Clone for kinds 21001/2/3, client + server | +| Encrypted req/resp event pattern | 📦 Mirror | `nip47WalletConnect/events/NwcRequestEvent.kt` (kind 23194) | Clone for kinds 21001/2/3, client + server | | Request/response over relay | ✅ Reuse | `Nip47Client.responseFilter()`, `relayClient/reqCommand/nwc/` | Same filter-by-`e`-tag pattern | | BOLT-11 parsing | ✅ Reuse | `quartz/.../lightning/LnInvoiceUtil.kt` | Use as-is | | LN payment execution | ✅ Reuse | `amethyst/.../service/ZapPaymentHandler.kt`, `NwcSignerState` | Add CLINK routes | @@ -85,7 +85,7 @@ with `events/`, `pointers/`, `rpc/` subfolders. 3. **Events** — `OfferEvent(21001)`, `DebitEvent(21002)`, `ManageEvent(21003)`, each `isContentEncoded() = true`, with `createRequest()` / `createResponse()` companions that NIP-44-encrypt JSON and set `p` / `clink_version` / `e` tags - (direct analogue of `LnZapPaymentRequestEvent`). Register in `EventFactory`. + (direct analogue of `NwcRequestEvent`). Register in `EventFactory`. 4. **DTOs + errors** — Jackson request/response classes per spec, shared `GfyError(code, message, range?, retryAfter?, delta?)`, Offers error model (`code` 1..5, `range`, `latest`). diff --git a/quartz/src/androidDeviceTest/kotlin/com/vitorpamplona/quartz/nip47WalletConnect/LnZapPaymentRequestNip44EventTest.kt b/quartz/src/androidDeviceTest/kotlin/com/vitorpamplona/quartz/nip47WalletConnect/NwcRequestNip44EventTest.kt similarity index 98% rename from quartz/src/androidDeviceTest/kotlin/com/vitorpamplona/quartz/nip47WalletConnect/LnZapPaymentRequestNip44EventTest.kt rename to quartz/src/androidDeviceTest/kotlin/com/vitorpamplona/quartz/nip47WalletConnect/NwcRequestNip44EventTest.kt index e3e0232e4f..8758bed7ad 100644 --- a/quartz/src/androidDeviceTest/kotlin/com/vitorpamplona/quartz/nip47WalletConnect/LnZapPaymentRequestNip44EventTest.kt +++ b/quartz/src/androidDeviceTest/kotlin/com/vitorpamplona/quartz/nip47WalletConnect/NwcRequestNip44EventTest.kt @@ -35,7 +35,7 @@ import kotlin.test.assertEquals import kotlin.test.assertIs @RunWith(AndroidJUnit4::class) -class LnZapPaymentRequestNip44EventTest { +class NwcRequestNip44EventTest { @Test fun testCreateRequestWithNip44() = runTest { diff --git a/quartz/src/androidMain/kotlin/com/vitorpamplona/quartz/nip55AndroidSigner/api/SignerResult.kt b/quartz/src/androidMain/kotlin/com/vitorpamplona/quartz/nip55AndroidSigner/api/SignerResult.kt index 2191d6a903..63dae210a5 100644 --- a/quartz/src/androidMain/kotlin/com/vitorpamplona/quartz/nip55AndroidSigner/api/SignerResult.kt +++ b/quartz/src/androidMain/kotlin/com/vitorpamplona/quartz/nip55AndroidSigner/api/SignerResult.kt @@ -22,7 +22,7 @@ package com.vitorpamplona.quartz.nip55AndroidSigner.api import com.vitorpamplona.quartz.nip01Core.core.Event import com.vitorpamplona.quartz.nip01Core.core.HexKey -import com.vitorpamplona.quartz.nip57Zaps.LnZapPrivateEvent +import com.vitorpamplona.quartz.nip57Zaps.PrivateZapEvent sealed interface SignerResult { sealed interface RequestAddressed : SignerResult { @@ -83,7 +83,7 @@ data class DecryptionResult( ) : IResult data class ZapEventDecryptionResult( - val privateEvent: LnZapPrivateEvent, + val privateEvent: PrivateZapEvent, ) : IResult data class DerivationResult( diff --git a/quartz/src/androidMain/kotlin/com/vitorpamplona/quartz/nip55AndroidSigner/api/background/queries/DecryptZapQuery.kt b/quartz/src/androidMain/kotlin/com/vitorpamplona/quartz/nip55AndroidSigner/api/background/queries/DecryptZapQuery.kt index b41c591e9c..bb9cf0c4f7 100644 --- a/quartz/src/androidMain/kotlin/com/vitorpamplona/quartz/nip55AndroidSigner/api/background/queries/DecryptZapQuery.kt +++ b/quartz/src/androidMain/kotlin/com/vitorpamplona/quartz/nip55AndroidSigner/api/background/queries/DecryptZapQuery.kt @@ -30,7 +30,7 @@ import com.vitorpamplona.quartz.nip55AndroidSigner.api.SignerResult import com.vitorpamplona.quartz.nip55AndroidSigner.api.ZapEventDecryptionResult import com.vitorpamplona.quartz.nip55AndroidSigner.api.background.utils.getStringByName import com.vitorpamplona.quartz.nip55AndroidSigner.api.background.utils.query -import com.vitorpamplona.quartz.nip57Zaps.LnZapPrivateEvent +import com.vitorpamplona.quartz.nip57Zaps.PrivateZapEvent class DecryptZapQuery( val loggedInUser: HexKey, @@ -45,7 +45,7 @@ class DecryptZapQuery( val decryptedEventAsJson = cursor.getStringByName("result") if (!decryptedEventAsJson.isNullOrBlank()) { if (decryptedEventAsJson.startsWith("{")) { - val event = Event.fromJsonOrNull(decryptedEventAsJson) as? LnZapPrivateEvent + val event = Event.fromJsonOrNull(decryptedEventAsJson) as? PrivateZapEvent if (event != null) { if (event.verify()) { SignerResult.RequestAddressed.Successful(ZapEventDecryptionResult(event)) diff --git a/quartz/src/androidMain/kotlin/com/vitorpamplona/quartz/nip55AndroidSigner/api/foreground/intents/responses/DecryptZapResponse.kt b/quartz/src/androidMain/kotlin/com/vitorpamplona/quartz/nip55AndroidSigner/api/foreground/intents/responses/DecryptZapResponse.kt index 38b7253126..f39e730a00 100644 --- a/quartz/src/androidMain/kotlin/com/vitorpamplona/quartz/nip55AndroidSigner/api/foreground/intents/responses/DecryptZapResponse.kt +++ b/quartz/src/androidMain/kotlin/com/vitorpamplona/quartz/nip55AndroidSigner/api/foreground/intents/responses/DecryptZapResponse.kt @@ -24,11 +24,11 @@ import com.vitorpamplona.quartz.nip01Core.core.Event import com.vitorpamplona.quartz.nip55AndroidSigner.api.SignerResult import com.vitorpamplona.quartz.nip55AndroidSigner.api.ZapEventDecryptionResult import com.vitorpamplona.quartz.nip55AndroidSigner.api.foreground.intents.results.IntentResult -import com.vitorpamplona.quartz.nip57Zaps.LnZapPrivateEvent +import com.vitorpamplona.quartz.nip57Zaps.PrivateZapEvent class DecryptZapResponse { companion object { - fun assemble(event: LnZapPrivateEvent): IntentResult = + fun assemble(event: PrivateZapEvent): IntentResult = IntentResult( result = event.toJson(), ) @@ -40,7 +40,7 @@ class DecryptZapResponse { val eventJson = intent.result return if (!eventJson.isNullOrBlank()) { if (eventJson.startsWith("{")) { - val event = Event.fromJsonOrNull(eventJson) as? LnZapPrivateEvent + val event = Event.fromJsonOrNull(eventJson) as? PrivateZapEvent if (event != null) { SignerResult.RequestAddressed.Successful(ZapEventDecryptionResult(event)) } else { diff --git a/quartz/src/androidMain/kotlin/com/vitorpamplona/quartz/nip55AndroidSigner/client/NostrSignerExternal.kt b/quartz/src/androidMain/kotlin/com/vitorpamplona/quartz/nip55AndroidSigner/client/NostrSignerExternal.kt index c5d1a6c388..218ca03dbc 100644 --- a/quartz/src/androidMain/kotlin/com/vitorpamplona/quartz/nip55AndroidSigner/client/NostrSignerExternal.kt +++ b/quartz/src/androidMain/kotlin/com/vitorpamplona/quartz/nip55AndroidSigner/client/NostrSignerExternal.kt @@ -36,7 +36,7 @@ import com.vitorpamplona.quartz.nip55AndroidSigner.api.SignerResult import com.vitorpamplona.quartz.nip55AndroidSigner.api.ZapEventDecryptionResult import com.vitorpamplona.quartz.nip55AndroidSigner.client.handlers.BackgroundRequestHandler import com.vitorpamplona.quartz.nip55AndroidSigner.client.handlers.ForegroundRequestHandler -import com.vitorpamplona.quartz.nip57Zaps.LnZapPrivateEvent +import com.vitorpamplona.quartz.nip57Zaps.PrivateZapEvent import com.vitorpamplona.quartz.nip57Zaps.ZapRequestEvent class NostrSignerExternal( @@ -163,7 +163,7 @@ class NostrSignerExternal( throw convertExceptions("Could not derive key", result) } - override suspend fun decryptZapEvent(event: ZapRequestEvent): LnZapPrivateEvent { + override suspend fun decryptZapEvent(event: ZapRequestEvent): PrivateZapEvent { if (!event.isPrivateZap()) throw SignerExceptions.NothingToDecrypt() val result = backgroundQuery.decryptZapEvent(event) ?: foregroundQuery.decryptZapEvent(event) diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/kinds/KindNames.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/kinds/KindNames.kt index fd07f11def..a4f4695cd4 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/kinds/KindNames.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/kinds/KindNames.kt @@ -161,21 +161,20 @@ import com.vitorpamplona.quartz.nip51Lists.appCurationSet.AppCurationSetEvent import com.vitorpamplona.quartz.nip51Lists.articleCurationSet.ArticleCurationSetEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.BookmarkListEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.OldBookmarkListEvent +import com.vitorpamplona.quartz.nip51Lists.bookmarkSet.BookmarkSetEvent import com.vitorpamplona.quartz.nip51Lists.favoriteAlgoFeedsList.FavoriteAlgoFeedsListEvent -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.followSet.FollowSetEvent import com.vitorpamplona.quartz.nip51Lists.geohashList.GeohashListEvent import com.vitorpamplona.quartz.nip51Lists.gitAuthorList.GitAuthorListEvent import com.vitorpamplona.quartz.nip51Lists.gitRepositoryList.GitRepositoryListEvent import com.vitorpamplona.quartz.nip51Lists.goodWikiAuthorList.GoodWikiAuthorListEvent import com.vitorpamplona.quartz.nip51Lists.goodWikiRelayList.GoodWikiRelayListEvent -import com.vitorpamplona.quartz.nip51Lists.hashtagList.InterestListEvent +import com.vitorpamplona.quartz.nip51Lists.interestList.InterestListEvent import com.vitorpamplona.quartz.nip51Lists.interestSet.InterestSetEvent import com.vitorpamplona.quartz.nip51Lists.kindMuteSet.KindMuteSetEvent -import com.vitorpamplona.quartz.nip51Lists.labeledBookmarkList.BookmarkSetEvent import com.vitorpamplona.quartz.nip51Lists.mediaFollowList.MediaFollowListEvent import com.vitorpamplona.quartz.nip51Lists.mediaStarterPack.MediaStarterPackEvent import com.vitorpamplona.quartz.nip51Lists.muteList.MuteListEvent -import com.vitorpamplona.quartz.nip51Lists.peopleList.FollowSetEvent import com.vitorpamplona.quartz.nip51Lists.pictureCurationSet.PictureCurationSetEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.BlockedRelayListEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.BroadcastRelayListEvent @@ -186,6 +185,7 @@ import com.vitorpamplona.quartz.nip51Lists.relayLists.TrustedRelayListEvent import com.vitorpamplona.quartz.nip51Lists.relaySets.RelaySetEvent import com.vitorpamplona.quartz.nip51Lists.releaseArtifactSet.ReleaseArtifactSetEvent import com.vitorpamplona.quartz.nip51Lists.simpleGroupList.SimpleGroupListEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import com.vitorpamplona.quartz.nip51Lists.videoCurationSet.VideoCurationSetEvent import com.vitorpamplona.quartz.nip52Calendar.appt.day.CalendarDateSlotEvent import com.vitorpamplona.quartz.nip52Calendar.appt.time.CalendarTimeSlotEvent @@ -204,7 +204,7 @@ import com.vitorpamplona.quartz.nip54Wiki.WikiMergeAcceptanceEvent import com.vitorpamplona.quartz.nip54Wiki.WikiMergeRequestEvent import com.vitorpamplona.quartz.nip54Wiki.WikiRedirectEvent import com.vitorpamplona.quartz.nip56Reports.ReportEvent -import com.vitorpamplona.quartz.nip57Zaps.LnZapPrivateEvent +import com.vitorpamplona.quartz.nip57Zaps.PrivateZapEvent import com.vitorpamplona.quartz.nip57Zaps.ZapReceiptEvent import com.vitorpamplona.quartz.nip57Zaps.ZapRequestEvent import com.vitorpamplona.quartz.nip58Badges.accepted.AcceptedBadgeSetEvent @@ -452,7 +452,7 @@ object KindNames { ZapReceiptEvent.KIND to KindName("Zaps", "57"), NwcRequestEvent.KIND to KindName("NWC Request", "47"), NwcResponseEvent.KIND to KindName("NWC Response", "47"), - LnZapPrivateEvent.KIND to KindName("Private Zaps", "57"), + PrivateZapEvent.KIND to KindName("Private Zaps", "57"), ZapRequestEvent.KIND to KindName("Zap Req", "57"), LongFormContentEvent.KIND to KindName("Blogs", "23"), MeetingRoomEvent.KIND to KindName("Meeting Room", "53"), diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/marmot/MarmotInboundProcessor.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/marmot/MarmotInboundProcessor.kt index a1c6d5fb53..4110efe500 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/marmot/MarmotInboundProcessor.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/marmot/MarmotInboundProcessor.kt @@ -379,7 +379,7 @@ class MarmotInboundProcessor( /** * Process a WelcomeEvent after NIP-59 gift wrap unwrapping. * - * Called by the platform layer after unwrapping a GiftWrap → SealedRumor → WelcomeEvent. + * Called by the platform layer after unwrapping a GiftWrap → Seal → WelcomeEvent. * * Flow: * 1. Extract welcome bytes and KeyPackage event ID diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/marmot/mip02Welcome/WelcomeGiftWrap.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/marmot/mip02Welcome/WelcomeGiftWrap.kt index 2f4cc00f48..9558c6fc4d 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/marmot/mip02Welcome/WelcomeGiftWrap.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/marmot/mip02Welcome/WelcomeGiftWrap.kt @@ -81,7 +81,7 @@ object WelcomeGiftWrap { // Step 2: Create a Rumor from the unsigned event and seal it (kind:13) val rumor = Rumor.create(welcomeRumor) - val sealedRumor = + val sealEvent = SealEvent.create( rumor = rumor, encryptTo = recipientPubKey, @@ -90,7 +90,7 @@ object WelcomeGiftWrap { // Step 3: Gift wrap (kind:1059) with an ephemeral key to the recipient return GiftWrapEvent.create( - event = sealedRumor, + event = sealEvent, recipientPubKey = recipientPubKey, ) } diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip01Core/signers/NostrSigner.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip01Core/signers/NostrSigner.kt index b87513ce80..bf50e9cd50 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip01Core/signers/NostrSigner.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip01Core/signers/NostrSigner.kt @@ -23,7 +23,7 @@ package com.vitorpamplona.quartz.nip01Core.signers import com.vitorpamplona.quartz.nip01Core.core.Event import com.vitorpamplona.quartz.nip01Core.core.HexKey import com.vitorpamplona.quartz.nip04Dm.crypto.EncryptedInfo -import com.vitorpamplona.quartz.nip57Zaps.LnZapPrivateEvent +import com.vitorpamplona.quartz.nip57Zaps.PrivateZapEvent import com.vitorpamplona.quartz.nip57Zaps.ZapRequestEvent abstract class NostrSigner( @@ -67,7 +67,7 @@ abstract class NostrSigner( fromPublicKey: HexKey, ): String - abstract suspend fun decryptZapEvent(event: ZapRequestEvent): LnZapPrivateEvent + abstract suspend fun decryptZapEvent(event: ZapRequestEvent): PrivateZapEvent abstract suspend fun deriveKey(nonce: HexKey): HexKey diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip01Core/signers/NostrSignerInternal.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip01Core/signers/NostrSignerInternal.kt index acb512e5c6..006fd3791c 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip01Core/signers/NostrSignerInternal.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip01Core/signers/NostrSignerInternal.kt @@ -24,7 +24,7 @@ import com.vitorpamplona.quartz.nip01Core.core.Event import com.vitorpamplona.quartz.nip01Core.core.HexKey import com.vitorpamplona.quartz.nip01Core.core.toHexKey import com.vitorpamplona.quartz.nip01Core.crypto.KeyPair -import com.vitorpamplona.quartz.nip57Zaps.LnZapPrivateEvent +import com.vitorpamplona.quartz.nip57Zaps.PrivateZapEvent import com.vitorpamplona.quartz.nip57Zaps.ZapRequestEvent import kotlinx.coroutines.CancellationException @@ -89,7 +89,7 @@ class NostrSignerInternal( // always ready override fun hasForegroundSupport() = true - override suspend fun decryptZapEvent(event: ZapRequestEvent): LnZapPrivateEvent { + override suspend fun decryptZapEvent(event: ZapRequestEvent): PrivateZapEvent { if (!event.isPrivateZap()) throw SignerExceptions.NothingToDecrypt() return runWrapErrors { diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip01Core/signers/NostrSignerSync.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip01Core/signers/NostrSignerSync.kt index 90566d4e7c..a821b95976 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip01Core/signers/NostrSignerSync.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip01Core/signers/NostrSignerSync.kt @@ -30,7 +30,7 @@ import com.vitorpamplona.quartz.nip01Core.crypto.KeyPair import com.vitorpamplona.quartz.nip04Dm.crypto.EncryptedInfo import com.vitorpamplona.quartz.nip04Dm.crypto.Nip04 import com.vitorpamplona.quartz.nip44Encryption.Nip44 -import com.vitorpamplona.quartz.nip57Zaps.LnZapPrivateEvent +import com.vitorpamplona.quartz.nip57Zaps.PrivateZapEvent import com.vitorpamplona.quartz.nip57Zaps.PrivateZapRequestBuilder import com.vitorpamplona.quartz.nip57Zaps.ZapRequestEvent import com.vitorpamplona.quartz.nipBCOnchainZaps.psbt.Psbt @@ -129,7 +129,7 @@ class NostrSignerSync( ) } - fun decryptZapEvent(event: ZapRequestEvent): LnZapPrivateEvent = PrivateZapRequestBuilder().decryptZapEvent(event, this) + fun decryptZapEvent(event: ZapRequestEvent): PrivateZapEvent = PrivateZapRequestBuilder().decryptZapEvent(event, this) /** * NIP-BC `sign_psbt`: sign the key-path P2TR inputs of [psbtHex] this key diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip13Pow/signer/PoWNostrSigner.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip13Pow/signer/PoWNostrSigner.kt index 3e9e00597d..770c08923d 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip13Pow/signer/PoWNostrSigner.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip13Pow/signer/PoWNostrSigner.kt @@ -26,7 +26,7 @@ import com.vitorpamplona.quartz.nip01Core.signers.EventTemplate import com.vitorpamplona.quartz.nip01Core.signers.NostrSigner import com.vitorpamplona.quartz.nip13Pow.miner.PoWMiner import com.vitorpamplona.quartz.nip13Pow.tags.PoWTag -import com.vitorpamplona.quartz.nip57Zaps.LnZapPrivateEvent +import com.vitorpamplona.quartz.nip57Zaps.PrivateZapEvent import com.vitorpamplona.quartz.nip57Zaps.ZapRequestEvent /** @@ -98,7 +98,7 @@ class PoWNostrSigner( fromPublicKey: HexKey, ): String = signer.nip44Decrypt(ciphertext, fromPublicKey) - override suspend fun decryptZapEvent(event: ZapRequestEvent): LnZapPrivateEvent = signer.decryptZapEvent(event) + override suspend fun decryptZapEvent(event: ZapRequestEvent): PrivateZapEvent = signer.decryptZapEvent(event) override suspend fun deriveKey(nonce: HexKey): HexKey = signer.deriveKey(nonce) diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip28PublicChat/list/ChannelListDiff.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip28PublicChat/list/PublicChatListDiff.kt similarity index 84% rename from quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip28PublicChat/list/ChannelListDiff.kt rename to quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip28PublicChat/list/PublicChatListDiff.kt index 69ab74f29c..3143cb4363 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip28PublicChat/list/ChannelListDiff.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip28PublicChat/list/PublicChatListDiff.kt @@ -28,9 +28,15 @@ import com.vitorpamplona.quartz.nip28PublicChat.list.tags.ChannelTag /** Changes to the joined public chats: public channels as parsed tags, private ones as a whole. */ @Immutable -class ChannelListDiff( +class PublicChatListDiff( val channels: ListDiff, val privateItems: ContentChange, ) : EventDiff { override fun removesData() = privateItems.publicRemovalsAreLoss(channels.hasRemovals()) || privateItems.isRemoval() } + +@Deprecated( + "Renamed to PublicChatListDiff. Follows the ChannelListEvent to PublicChatListEvent rename (NIP-51 public chats list).", + ReplaceWith("PublicChatListDiff", "com.vitorpamplona.quartz.nip28PublicChat.list.PublicChatListDiff"), +) +typealias ChannelListDiff = PublicChatListDiff diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip28PublicChat/list/PublicChatListEvent.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip28PublicChat/list/PublicChatListEvent.kt index 08cdbbb345..78dd9fc4eb 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip28PublicChat/list/PublicChatListEvent.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip28PublicChat/list/PublicChatListEvent.kt @@ -50,11 +50,11 @@ class PublicChatListEvent( content: String, sig: HexKey, ) : PrivateTagArrayEvent(id, pubKey, createdAt, KIND, tags, content, sig), - DiffableEvent, + DiffableEvent, EventHintProvider { - override fun diffFrom(older: Event): ChannelListDiff? { + override fun diffFrom(older: Event): PublicChatListDiff? { if (older !is PublicChatListEvent || older.pubKey != pubKey || older.dTag() != dTag()) return null - return ChannelListDiff( + return PublicChatListDiff( ListDiff.of(older.tags.channels(), tags.channels(), { it.eventId }, { a, b -> a.relay == b.relay }), privateItemsChangeFrom(older), ) diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip46RemoteSigner/signer/NostrSignerRemote.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip46RemoteSigner/signer/NostrSignerRemote.kt index f58bd0ad69..5a7820cc32 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip46RemoteSigner/signer/NostrSignerRemote.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip46RemoteSigner/signer/NostrSignerRemote.kt @@ -40,7 +40,7 @@ import com.vitorpamplona.quartz.nip46RemoteSigner.BunkerRequestNip44Encrypt import com.vitorpamplona.quartz.nip46RemoteSigner.BunkerRequestPing import com.vitorpamplona.quartz.nip46RemoteSigner.BunkerRequestSign import com.vitorpamplona.quartz.nip46RemoteSigner.NostrConnectEvent -import com.vitorpamplona.quartz.nip57Zaps.LnZapPrivateEvent +import com.vitorpamplona.quartz.nip57Zaps.PrivateZapEvent import com.vitorpamplona.quartz.nip57Zaps.ZapRequestEvent import com.vitorpamplona.quartz.utils.Hex import com.vitorpamplona.quartz.utils.Log @@ -325,7 +325,7 @@ class NostrSignerRemote( throw convertExceptions("Could not get public key", result) } - override suspend fun decryptZapEvent(event: ZapRequestEvent): LnZapPrivateEvent { + override suspend fun decryptZapEvent(event: ZapRequestEvent): PrivateZapEvent { TODO("Not yet implemented") } diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip50Search/SearchFieldExtractor.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip50Search/SearchFieldExtractor.kt index e6176a77fb..139530d089 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip50Search/SearchFieldExtractor.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip50Search/SearchFieldExtractor.kt @@ -71,14 +71,14 @@ import com.vitorpamplona.quartz.nip51Lists.appCurationSet.AppCurationSetEvent import com.vitorpamplona.quartz.nip51Lists.articleCurationSet.ArticleCurationSetEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.BookmarkListEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.OldBookmarkListEvent -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.bookmarkSet.BookmarkSetEvent +import com.vitorpamplona.quartz.nip51Lists.followSet.FollowSetEvent import com.vitorpamplona.quartz.nip51Lists.interestSet.InterestSetEvent -import com.vitorpamplona.quartz.nip51Lists.labeledBookmarkList.BookmarkSetEvent import com.vitorpamplona.quartz.nip51Lists.mediaStarterPack.MediaStarterPackEvent -import com.vitorpamplona.quartz.nip51Lists.peopleList.FollowSetEvent import com.vitorpamplona.quartz.nip51Lists.pictureCurationSet.PictureCurationSetEvent import com.vitorpamplona.quartz.nip51Lists.relaySets.RelaySetEvent import com.vitorpamplona.quartz.nip51Lists.releaseArtifactSet.ReleaseArtifactSetEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import com.vitorpamplona.quartz.nip51Lists.videoCurationSet.VideoCurationSetEvent import com.vitorpamplona.quartz.nip52Calendar.appt.day.CalendarDateSlotEvent import com.vitorpamplona.quartz.nip52Calendar.appt.time.CalendarTimeSlotEvent @@ -607,7 +607,7 @@ object SearchFieldExtractor { // kinds 1111/1311 -- body-only kinds whose indexableContent() // concatenates the `t` tags INTO the body. The funnel already // carries them in the hashtag role, so passing the body alone - // stops the same words being indexed twice (the ContactCard + // stops the same words being indexed twice (the UserAssertion // reasoning above, applied to the two chat/comment kinds). is CommentEvent -> { tiers(event, null, null, event.content) diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/labeledBookmarkList/BookmarkSetEvent.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/bookmarkSet/BookmarkSetEvent.kt similarity index 97% rename from quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/labeledBookmarkList/BookmarkSetEvent.kt rename to quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/bookmarkSet/BookmarkSetEvent.kt index 01494372a3..318f74f5c5 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/labeledBookmarkList/BookmarkSetEvent.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/bookmarkSet/BookmarkSetEvent.kt @@ -18,7 +18,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.quartz.nip51Lists.labeledBookmarkList +package com.vitorpamplona.quartz.nip51Lists.bookmarkSet import androidx.compose.runtime.Immutable import com.vitorpamplona.quartz.nip01Core.core.Address @@ -335,9 +335,3 @@ class BookmarkSetEvent( } } } - -@Deprecated( - "Renamed to BookmarkSetEvent. NIP-51 names kind 30003 bookmark sets.", - ReplaceWith("BookmarkSetEvent", "com.vitorpamplona.quartz.nip51Lists.labeledBookmarkList.BookmarkSetEvent"), -) -typealias LabeledBookmarkListEvent = BookmarkSetEvent diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/labeledBookmarkList/TagArrayBuilderExt.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/bookmarkSet/TagArrayBuilderExt.kt similarity index 97% rename from quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/labeledBookmarkList/TagArrayBuilderExt.kt rename to quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/bookmarkSet/TagArrayBuilderExt.kt index 5754f4f9f2..568b662ff4 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/labeledBookmarkList/TagArrayBuilderExt.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/bookmarkSet/TagArrayBuilderExt.kt @@ -18,7 +18,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.quartz.nip51Lists.labeledBookmarkList +package com.vitorpamplona.quartz.nip51Lists.bookmarkSet import com.vitorpamplona.quartz.nip01Core.core.TagArrayBuilder import com.vitorpamplona.quartz.nip51Lists.bookmarkList.tags.BookmarkIdTag diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/followList/Deprecated.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/followList/Deprecated.kt new file mode 100644 index 0000000000..f4ba91cd99 --- /dev/null +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/followList/Deprecated.kt @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2025 Vitor Pamplona + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +@file:Suppress("DEPRECATION") + +package com.vitorpamplona.quartz.nip51Lists.followList + +import com.vitorpamplona.quartz.nip01Core.core.HexKey +import com.vitorpamplona.quartz.nip01Core.core.TagArray +import com.vitorpamplona.quartz.nip01Core.core.TagArrayBuilder +import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl +import com.vitorpamplona.quartz.nip51Lists.muteList.tags.UserTag +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.description as movedDescription +import com.vitorpamplona.quartz.nip51Lists.starterPack.followIdSet as movedFollowIdSet +import com.vitorpamplona.quartz.nip51Lists.starterPack.followIds as movedFollowIds +import com.vitorpamplona.quartz.nip51Lists.starterPack.follows as movedFollows +import com.vitorpamplona.quartz.nip51Lists.starterPack.image as movedImage +import com.vitorpamplona.quartz.nip51Lists.starterPack.people as movedPeople +import com.vitorpamplona.quartz.nip51Lists.starterPack.person as movedPerson +import com.vitorpamplona.quartz.nip51Lists.starterPack.personFirst as movedPersonFirst +import com.vitorpamplona.quartz.nip51Lists.starterPack.removePerson as movedRemovePerson +import com.vitorpamplona.quartz.nip51Lists.starterPack.title as movedTitle + +// This package was renamed to com.vitorpamplona.quartz.nip51Lists.starterPack (NIP-51 kind 39089 is a starter pack). +// Everything below forwards to it and will be removed in a future release. + +private const val MOVED = "Moved to com.vitorpamplona.quartz.nip51Lists.starterPack" + +@Deprecated( + "Renamed to StarterPackEvent and moved to com.vitorpamplona.quartz.nip51Lists.starterPack. NIP-51 kind 39089 is a starter pack.", + ReplaceWith("StarterPackEvent", "com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent"), +) +typealias FollowListEvent = StarterPackEvent + +@Deprecated(MOVED, ReplaceWith("title(title)", "com.vitorpamplona.quartz.nip51Lists.starterPack.title")) +fun TagArrayBuilder.title(title: String) = movedTitle(title) + +@Deprecated(MOVED, ReplaceWith("description(desc)", "com.vitorpamplona.quartz.nip51Lists.starterPack.description")) +fun TagArrayBuilder.description(desc: String) = movedDescription(desc) + +@Deprecated(MOVED, ReplaceWith("image(imageUrl)", "com.vitorpamplona.quartz.nip51Lists.starterPack.image")) +fun TagArrayBuilder.image(imageUrl: String) = movedImage(imageUrl) + +@Deprecated(MOVED, ReplaceWith("people(peoples)", "com.vitorpamplona.quartz.nip51Lists.starterPack.people")) +fun TagArrayBuilder.people(peoples: List) = movedPeople(peoples) + +@Deprecated(MOVED, ReplaceWith("person(person)", "com.vitorpamplona.quartz.nip51Lists.starterPack.person")) +fun TagArrayBuilder.person(person: UserTag) = movedPerson(person) + +@Deprecated(MOVED, ReplaceWith("person(pubkey, relayHint)", "com.vitorpamplona.quartz.nip51Lists.starterPack.person")) +fun TagArrayBuilder.person( + pubkey: HexKey, + relayHint: NormalizedRelayUrl?, +) = movedPerson(pubkey, relayHint) + +@Deprecated(MOVED, ReplaceWith("personFirst(pubkey, relayHint)", "com.vitorpamplona.quartz.nip51Lists.starterPack.personFirst")) +fun TagArrayBuilder.personFirst( + pubkey: HexKey, + relayHint: NormalizedRelayUrl?, +) = movedPersonFirst(pubkey, relayHint) + +@Deprecated(MOVED, ReplaceWith("removePerson(pubkey)", "com.vitorpamplona.quartz.nip51Lists.starterPack.removePerson")) +fun TagArrayBuilder.removePerson(pubkey: HexKey) = movedRemovePerson(pubkey) + +@Deprecated(MOVED, ReplaceWith("follows()", "com.vitorpamplona.quartz.nip51Lists.starterPack.follows")) +fun TagArray.follows() = movedFollows() + +@Deprecated(MOVED, ReplaceWith("followIds()", "com.vitorpamplona.quartz.nip51Lists.starterPack.followIds")) +fun TagArray.followIds() = movedFollowIds() + +@Deprecated(MOVED, ReplaceWith("followIdSet()", "com.vitorpamplona.quartz.nip51Lists.starterPack.followIdSet")) +fun TagArray.followIdSet() = movedFollowIdSet() diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/peopleList/FollowSetEvent.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/followSet/FollowSetEvent.kt similarity index 98% rename from quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/peopleList/FollowSetEvent.kt rename to quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/followSet/FollowSetEvent.kt index d10d7de69b..fe0353dd48 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/peopleList/FollowSetEvent.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/followSet/FollowSetEvent.kt @@ -18,7 +18,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.quartz.nip51Lists.peopleList +package com.vitorpamplona.quartz.nip51Lists.followSet import androidx.compose.runtime.Immutable import com.vitorpamplona.quartz.nip01Core.core.Address @@ -415,9 +415,3 @@ class FollowSetEvent( ) } } - -@Deprecated( - "Renamed to FollowSetEvent. NIP-51 names kind 30000 follow sets.", - ReplaceWith("FollowSetEvent", "com.vitorpamplona.quartz.nip51Lists.peopleList.FollowSetEvent"), -) -typealias PeopleListEvent = FollowSetEvent diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/peopleList/TagArrayBuilderExt.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/followSet/TagArrayBuilderExt.kt similarity index 97% rename from quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/peopleList/TagArrayBuilderExt.kt rename to quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/followSet/TagArrayBuilderExt.kt index 9a07db2fec..18e1ef4cba 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/peopleList/TagArrayBuilderExt.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/followSet/TagArrayBuilderExt.kt @@ -18,7 +18,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.quartz.nip51Lists.peopleList +package com.vitorpamplona.quartz.nip51Lists.followSet import com.vitorpamplona.quartz.nip01Core.core.TagArrayBuilder import com.vitorpamplona.quartz.nip51Lists.muteList.tags.UserTag diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/peopleList/TagArrayExt.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/followSet/TagArrayExt.kt similarity index 96% rename from quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/peopleList/TagArrayExt.kt rename to quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/followSet/TagArrayExt.kt index bad2b2563c..d0cd484542 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/peopleList/TagArrayExt.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/followSet/TagArrayExt.kt @@ -18,7 +18,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.quartz.nip51Lists.peopleList +package com.vitorpamplona.quartz.nip51Lists.followSet import com.vitorpamplona.quartz.nip01Core.core.TagArray import com.vitorpamplona.quartz.nip51Lists.muteList.tags.MuteTag diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/hashtagList/Deprecated.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/hashtagList/Deprecated.kt new file mode 100644 index 0000000000..417d0575b9 --- /dev/null +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/hashtagList/Deprecated.kt @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2025 Vitor Pamplona + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +@file:Suppress("DEPRECATION") + +package com.vitorpamplona.quartz.nip51Lists.hashtagList + +import com.vitorpamplona.quartz.nip01Core.core.TagArray +import com.vitorpamplona.quartz.nip01Core.core.TagArrayBuilder +import com.vitorpamplona.quartz.nip51Lists.interestList.InterestListDiff +import com.vitorpamplona.quartz.nip51Lists.interestList.InterestListEvent +import com.vitorpamplona.quartz.nip51Lists.interestList.followHashTag as movedFollowHashTag +import com.vitorpamplona.quartz.nip51Lists.interestList.hashtagList as movedHashtagList +import com.vitorpamplona.quartz.nip51Lists.interestList.hashtagSet as movedHashtagSet +import com.vitorpamplona.quartz.nip51Lists.interestList.hashtags as movedHashtags + +// This package was renamed to com.vitorpamplona.quartz.nip51Lists.interestList (NIP-51 kind 10015 is the interests list). +// Everything below forwards to it and will be removed in a future release. + +private const val MOVED = "Moved to com.vitorpamplona.quartz.nip51Lists.interestList" + +@Deprecated( + "Renamed to InterestListEvent and moved to com.vitorpamplona.quartz.nip51Lists.interestList. NIP-51 kind 10015 is the interests list.", + ReplaceWith("InterestListEvent", "com.vitorpamplona.quartz.nip51Lists.interestList.InterestListEvent"), +) +typealias HashtagListEvent = InterestListEvent + +@Deprecated( + "Renamed to InterestListDiff and moved to com.vitorpamplona.quartz.nip51Lists.interestList. NIP-51 kind 10015 is the interests list.", + ReplaceWith("InterestListDiff", "com.vitorpamplona.quartz.nip51Lists.interestList.InterestListDiff"), +) +typealias HashtagListDiff = InterestListDiff + +@Deprecated(MOVED, ReplaceWith("followHashTag(hashtag)", "com.vitorpamplona.quartz.nip51Lists.interestList.followHashTag")) +fun TagArrayBuilder.followHashTag(hashtag: String) = movedFollowHashTag(hashtag) + +@Deprecated(MOVED, ReplaceWith("hashtags(hashtags)", "com.vitorpamplona.quartz.nip51Lists.interestList.hashtags")) +fun TagArrayBuilder.hashtags(hashtags: List) = movedHashtags(hashtags) + +@Deprecated(MOVED, ReplaceWith("hashtagList()", "com.vitorpamplona.quartz.nip51Lists.interestList.hashtagList")) +fun TagArray.hashtagList() = movedHashtagList() + +@Deprecated(MOVED, ReplaceWith("hashtagSet()", "com.vitorpamplona.quartz.nip51Lists.interestList.hashtagSet")) +fun TagArray.hashtagSet() = movedHashtagSet() diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/hashtagList/HashtagListDiff.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/interestList/InterestListDiff.kt similarity index 95% rename from quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/hashtagList/HashtagListDiff.kt rename to quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/interestList/InterestListDiff.kt index 21faacdee8..34284ce4db 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/hashtagList/HashtagListDiff.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/interestList/InterestListDiff.kt @@ -18,7 +18,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.quartz.nip51Lists.hashtagList +package com.vitorpamplona.quartz.nip51Lists.interestList import androidx.compose.runtime.Immutable import com.vitorpamplona.quartz.nip01Core.diff.ContentChange @@ -27,7 +27,7 @@ import com.vitorpamplona.quartz.nip01Core.diff.ListDiff /** Changes to the followed hashtags: public ones, and the private ones as a whole. */ @Immutable -class HashtagListDiff( +class InterestListDiff( val hashtags: ListDiff, val privateItems: ContentChange, ) : EventDiff { diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/hashtagList/InterestListEvent.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/interestList/InterestListEvent.kt similarity index 95% rename from quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/hashtagList/InterestListEvent.kt rename to quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/interestList/InterestListEvent.kt index 950fb6c7a9..eaac7eaab7 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/hashtagList/InterestListEvent.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/interestList/InterestListEvent.kt @@ -18,7 +18,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.quartz.nip51Lists.hashtagList +package com.vitorpamplona.quartz.nip51Lists.interestList import androidx.compose.runtime.Immutable import com.vitorpamplona.quartz.nip01Core.core.Address @@ -49,10 +49,10 @@ class InterestListEvent( content: String, sig: HexKey, ) : PrivateTagArrayEvent(id, pubKey, createdAt, KIND, tags, content, sig), - DiffableEvent { - override fun diffFrom(older: Event): HashtagListDiff? { + DiffableEvent { + override fun diffFrom(older: Event): InterestListDiff? { if (older !is InterestListEvent || older.pubKey != pubKey || older.dTag() != dTag()) return null - return HashtagListDiff( + return InterestListDiff( ListDiff.of(older.publicHashtags(), publicHashtags(), { it.lowercase() }), privateItemsChangeFrom(older), ) @@ -216,9 +216,3 @@ class InterestListEvent( } } } - -@Deprecated( - "Renamed to InterestListEvent. NIP-51 names kind 10015 the interests list.", - ReplaceWith("InterestListEvent", "com.vitorpamplona.quartz.nip51Lists.hashtagList.InterestListEvent"), -) -typealias HashtagListEvent = InterestListEvent diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/hashtagList/TagArrayBuilderExt.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/interestList/TagArrayBuilderExt.kt similarity index 96% rename from quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/hashtagList/TagArrayBuilderExt.kt rename to quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/interestList/TagArrayBuilderExt.kt index 70977ca9b7..4de4cce0d9 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/hashtagList/TagArrayBuilderExt.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/interestList/TagArrayBuilderExt.kt @@ -18,7 +18,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.quartz.nip51Lists.hashtagList +package com.vitorpamplona.quartz.nip51Lists.interestList import com.vitorpamplona.quartz.nip01Core.core.TagArrayBuilder import com.vitorpamplona.quartz.nip01Core.tags.hashtags.HashtagTag diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/hashtagList/TagArrayExt.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/interestList/TagArrayExt.kt similarity index 96% rename from quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/hashtagList/TagArrayExt.kt rename to quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/interestList/TagArrayExt.kt index ec7d75dd35..9819d231a8 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/hashtagList/TagArrayExt.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/interestList/TagArrayExt.kt @@ -18,7 +18,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.quartz.nip51Lists.hashtagList +package com.vitorpamplona.quartz.nip51Lists.interestList import com.vitorpamplona.quartz.nip01Core.core.TagArray import com.vitorpamplona.quartz.nip01Core.tags.hashtags.HashtagTag diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/labeledBookmarkList/Deprecated.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/labeledBookmarkList/Deprecated.kt new file mode 100644 index 0000000000..e420c86082 --- /dev/null +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/labeledBookmarkList/Deprecated.kt @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2025 Vitor Pamplona + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +@file:Suppress("DEPRECATION") + +package com.vitorpamplona.quartz.nip51Lists.labeledBookmarkList + +import com.vitorpamplona.quartz.nip01Core.core.TagArrayBuilder +import com.vitorpamplona.quartz.nip51Lists.bookmarkList.tags.BookmarkIdTag +import com.vitorpamplona.quartz.nip51Lists.bookmarkSet.BookmarkSetEvent +import com.vitorpamplona.quartz.nip51Lists.bookmarkSet.bookmarks as movedBookmarks +import com.vitorpamplona.quartz.nip51Lists.bookmarkSet.description as movedDescription +import com.vitorpamplona.quartz.nip51Lists.bookmarkSet.image as movedImage +import com.vitorpamplona.quartz.nip51Lists.bookmarkSet.name as movedName +import com.vitorpamplona.quartz.nip51Lists.bookmarkSet.title as movedTitle + +// This package was renamed to com.vitorpamplona.quartz.nip51Lists.bookmarkSet (NIP-51 kind 30003 is a bookmark set). +// Everything below forwards to it and will be removed in a future release. + +private const val MOVED = "Moved to com.vitorpamplona.quartz.nip51Lists.bookmarkSet" + +@Deprecated( + "Renamed to BookmarkSetEvent and moved to com.vitorpamplona.quartz.nip51Lists.bookmarkSet. NIP-51 kind 30003 is a bookmark set.", + ReplaceWith("BookmarkSetEvent", "com.vitorpamplona.quartz.nip51Lists.bookmarkSet.BookmarkSetEvent"), +) +typealias LabeledBookmarkListEvent = BookmarkSetEvent + +@Deprecated(MOVED, ReplaceWith("name(name)", "com.vitorpamplona.quartz.nip51Lists.bookmarkSet.name")) +fun TagArrayBuilder.name(name: String) = movedName(name) + +@Deprecated(MOVED, ReplaceWith("title(title)", "com.vitorpamplona.quartz.nip51Lists.bookmarkSet.title")) +fun TagArrayBuilder.title(title: String) = movedTitle(title) + +@Deprecated(MOVED, ReplaceWith("bookmarks(bookmarks)", "com.vitorpamplona.quartz.nip51Lists.bookmarkSet.bookmarks")) +fun TagArrayBuilder.bookmarks(bookmarks: List) = movedBookmarks(bookmarks) + +@Deprecated(MOVED, ReplaceWith("description(listDescription)", "com.vitorpamplona.quartz.nip51Lists.bookmarkSet.description")) +fun TagArrayBuilder.description(listDescription: String) = movedDescription(listDescription) + +@Deprecated(MOVED, ReplaceWith("image(url)", "com.vitorpamplona.quartz.nip51Lists.bookmarkSet.image")) +fun TagArrayBuilder.image(url: String) = movedImage(url) diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/mediaStarterPack/MediaStarterPackEvent.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/mediaStarterPack/MediaStarterPackEvent.kt index 9cec42f0c3..5d862bfc41 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/mediaStarterPack/MediaStarterPackEvent.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/mediaStarterPack/MediaStarterPackEvent.kt @@ -31,11 +31,11 @@ import com.vitorpamplona.quartz.nip01Core.signers.eventTemplate import com.vitorpamplona.quartz.nip01Core.tags.dTag.dTag import com.vitorpamplona.quartz.nip50Search.IndexableFieldVisitor import com.vitorpamplona.quartz.nip50Search.SearchableEvent -import com.vitorpamplona.quartz.nip51Lists.followList.followIdSet -import com.vitorpamplona.quartz.nip51Lists.followList.followIds -import com.vitorpamplona.quartz.nip51Lists.followList.follows import com.vitorpamplona.quartz.nip51Lists.muteList.tags.UserTag import com.vitorpamplona.quartz.nip51Lists.remove +import com.vitorpamplona.quartz.nip51Lists.starterPack.followIdSet +import com.vitorpamplona.quartz.nip51Lists.starterPack.followIds +import com.vitorpamplona.quartz.nip51Lists.starterPack.follows import com.vitorpamplona.quartz.nip51Lists.tags.DescriptionTag import com.vitorpamplona.quartz.nip51Lists.tags.ImageTag import com.vitorpamplona.quartz.nip51Lists.tags.TitleTag diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/peopleList/Deprecated.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/peopleList/Deprecated.kt new file mode 100644 index 0000000000..0e973677cc --- /dev/null +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/peopleList/Deprecated.kt @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2025 Vitor Pamplona + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +@file:Suppress("DEPRECATION") + +package com.vitorpamplona.quartz.nip51Lists.peopleList + +import com.vitorpamplona.quartz.nip01Core.core.TagArray +import com.vitorpamplona.quartz.nip01Core.core.TagArrayBuilder +import com.vitorpamplona.quartz.nip51Lists.followSet.FollowSetEvent +import com.vitorpamplona.quartz.nip51Lists.muteList.tags.UserTag +import com.vitorpamplona.quartz.nip51Lists.followSet.description as movedDescription +import com.vitorpamplona.quartz.nip51Lists.followSet.image as movedImage +import com.vitorpamplona.quartz.nip51Lists.followSet.name as movedName +import com.vitorpamplona.quartz.nip51Lists.followSet.peoples as movedPeoples +import com.vitorpamplona.quartz.nip51Lists.followSet.title as movedTitle +import com.vitorpamplona.quartz.nip51Lists.followSet.userIdSet as movedUserIdSet +import com.vitorpamplona.quartz.nip51Lists.followSet.userIds as movedUserIds +import com.vitorpamplona.quartz.nip51Lists.followSet.users as movedUsers +import com.vitorpamplona.quartz.nip51Lists.followSet.usersAndWords as movedUsersAndWords +import com.vitorpamplona.quartz.nip51Lists.followSet.wordSet as movedWordSet +import com.vitorpamplona.quartz.nip51Lists.followSet.words as movedWords + +// This package was renamed to com.vitorpamplona.quartz.nip51Lists.followSet (NIP-51 kind 30000 is a follow set). +// Everything below forwards to it and will be removed in a future release. + +private const val MOVED = "Moved to com.vitorpamplona.quartz.nip51Lists.followSet" + +@Deprecated( + "Renamed to FollowSetEvent and moved to com.vitorpamplona.quartz.nip51Lists.followSet. NIP-51 kind 30000 is a follow set.", + ReplaceWith("FollowSetEvent", "com.vitorpamplona.quartz.nip51Lists.followSet.FollowSetEvent"), +) +typealias PeopleListEvent = FollowSetEvent + +@Deprecated(MOVED, ReplaceWith("name(name)", "com.vitorpamplona.quartz.nip51Lists.followSet.name")) +fun TagArrayBuilder.name(name: String) = movedName(name) + +@Deprecated(MOVED, ReplaceWith("title(name)", "com.vitorpamplona.quartz.nip51Lists.followSet.title")) +fun TagArrayBuilder.title(name: String) = movedTitle(name) + +@Deprecated(MOVED, ReplaceWith("description(desc)", "com.vitorpamplona.quartz.nip51Lists.followSet.description")) +fun TagArrayBuilder.description(desc: String) = movedDescription(desc) + +@Deprecated(MOVED, ReplaceWith("image(url)", "com.vitorpamplona.quartz.nip51Lists.followSet.image")) +fun TagArrayBuilder.image(url: String) = movedImage(url) + +@Deprecated(MOVED, ReplaceWith("peoples(peoples)", "com.vitorpamplona.quartz.nip51Lists.followSet.peoples")) +fun TagArrayBuilder.peoples(peoples: List) = movedPeoples(peoples) + +@Deprecated(MOVED, ReplaceWith("usersAndWords()", "com.vitorpamplona.quartz.nip51Lists.followSet.usersAndWords")) +fun TagArray.usersAndWords() = movedUsersAndWords() + +@Deprecated(MOVED, ReplaceWith("users()", "com.vitorpamplona.quartz.nip51Lists.followSet.users")) +fun TagArray.users() = movedUsers() + +@Deprecated(MOVED, ReplaceWith("userIds()", "com.vitorpamplona.quartz.nip51Lists.followSet.userIds")) +fun TagArray.userIds() = movedUserIds() + +@Deprecated(MOVED, ReplaceWith("userIdSet()", "com.vitorpamplona.quartz.nip51Lists.followSet.userIdSet")) +fun TagArray.userIdSet() = movedUserIdSet() + +@Deprecated(MOVED, ReplaceWith("words()", "com.vitorpamplona.quartz.nip51Lists.followSet.words")) +fun TagArray.words() = movedWords() + +@Deprecated(MOVED, ReplaceWith("wordSet()", "com.vitorpamplona.quartz.nip51Lists.followSet.wordSet")) +fun TagArray.wordSet() = movedWordSet() diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/releaseArtifactSet/ReleaseArtifactSetEvent.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/releaseArtifactSet/ReleaseArtifactSetEvent.kt index b3c2dee634..0e8a9db9ab 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/releaseArtifactSet/ReleaseArtifactSetEvent.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/releaseArtifactSet/ReleaseArtifactSetEvent.kt @@ -25,6 +25,7 @@ import com.vitorpamplona.quartz.experimental.nip82SoftwareApps.asset.SoftwareAss import com.vitorpamplona.quartz.experimental.nip82SoftwareApps.release.appId import com.vitorpamplona.quartz.experimental.nip82SoftwareApps.release.assets import com.vitorpamplona.quartz.experimental.nip82SoftwareApps.release.channel +import com.vitorpamplona.quartz.experimental.nip82SoftwareApps.release.isNip82SoftwareRelease import com.vitorpamplona.quartz.experimental.nip82SoftwareApps.release.version import com.vitorpamplona.quartz.nip01Core.core.Address import com.vitorpamplona.quartz.nip01Core.core.BaseAddressableEvent @@ -70,15 +71,20 @@ class ReleaseArtifactSetEvent( EventHintProvider, AddressHintProvider, SearchableEvent { - override fun indexableContent() = listOfNotNull(title(), description()).joinToString("\n") + override fun indexableContent() = listOfNotNull(title(), description(), searchableReleaseNotes()).joinToString("\n") // The read path: the same fields indexableContent() joins, handed over without // building the joined string a scan would throw away. override fun forEachIndexableField(visitor: IndexableFieldVisitor) { if (!visitor.visit(title())) return - visitor.visit(description()) + if (!visitor.visit(description())) return + visitor.visit(searchableReleaseNotes()) } + // Only NIP-82 releases carry release notes in `content`. A NIP-51 set may keep + // encrypted private items there, which must never reach the index. + private fun searchableReleaseNotes() = if (isNip82SoftwareRelease()) content.ifBlank { null } else null + override fun eventHints() = tags.mapNotNull(EventBookmark::parseAsHint) override fun linkedEventIds() = tags.mapNotNull(EventBookmark::parseId) diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/followList/StarterPackEvent.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/starterPack/StarterPackEvent.kt similarity index 95% rename from quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/followList/StarterPackEvent.kt rename to quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/starterPack/StarterPackEvent.kt index c38841df66..81fc1f760f 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/followList/StarterPackEvent.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/starterPack/StarterPackEvent.kt @@ -18,7 +18,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.quartz.nip51Lists.followList +package com.vitorpamplona.quartz.nip51Lists.starterPack import androidx.compose.runtime.Immutable import com.vitorpamplona.quartz.nip01Core.core.Address @@ -184,9 +184,3 @@ class StarterPackEvent( } } } - -@Deprecated( - "Renamed to StarterPackEvent. Kind 39089 is a NIP-51 starter pack. The NIP-02 follow list is kind 3 (ContactListEvent).", - ReplaceWith("StarterPackEvent", "com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent"), -) -typealias FollowListEvent = StarterPackEvent diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/followList/TagArrayBuilderExt.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/starterPack/TagArrayBuilderExt.kt similarity index 97% rename from quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/followList/TagArrayBuilderExt.kt rename to quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/starterPack/TagArrayBuilderExt.kt index 6b5cf9bc13..4fcace3cf1 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/followList/TagArrayBuilderExt.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/starterPack/TagArrayBuilderExt.kt @@ -18,7 +18,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.quartz.nip51Lists.followList +package com.vitorpamplona.quartz.nip51Lists.starterPack import com.vitorpamplona.quartz.nip01Core.core.HexKey import com.vitorpamplona.quartz.nip01Core.core.TagArrayBuilder diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/followList/TagArrayExt.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/starterPack/TagArrayExt.kt similarity index 96% rename from quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/followList/TagArrayExt.kt rename to quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/starterPack/TagArrayExt.kt index e8f8a00bea..69303a2097 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/followList/TagArrayExt.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip51Lists/starterPack/TagArrayExt.kt @@ -18,7 +18,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.quartz.nip51Lists.followList +package com.vitorpamplona.quartz.nip51Lists.starterPack import com.vitorpamplona.quartz.nip01Core.core.TagArray import com.vitorpamplona.quartz.nip51Lists.muteList.tags.UserTag diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/IPrivateZapsDecryptionCache.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/IPrivateZapsDecryptionCache.kt index bae51c5c4f..3c36ab0fa2 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/IPrivateZapsDecryptionCache.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/IPrivateZapsDecryptionCache.kt @@ -25,7 +25,7 @@ package com.vitorpamplona.quartz.nip57Zaps * Used by Note.kt for checking private zap status. */ interface IPrivateZapsDecryptionCache { - fun cachedPrivateZap(event: ZapRequestEvent): LnZapPrivateEvent? + fun cachedPrivateZap(event: ZapRequestEvent): PrivateZapEvent? - suspend fun decryptPrivateZap(event: ZapRequestEvent): LnZapPrivateEvent? + suspend fun decryptPrivateZap(event: ZapRequestEvent): PrivateZapEvent? } diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/PrivateZapCache.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/PrivateZapCache.kt index 57eb0a796c..29319eb223 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/PrivateZapCache.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/PrivateZapCache.kt @@ -43,16 +43,16 @@ class PrivateZapCache( decryptionCache.remove(event) } - override fun cachedPrivateZap(event: ZapRequestEvent): LnZapPrivateEvent? = decryptionCache[event]?.cached() + override fun cachedPrivateZap(event: ZapRequestEvent): PrivateZapEvent? = decryptionCache[event]?.cached() override suspend fun decryptPrivateZap(event: ZapRequestEvent) = decryptionCache[event]?.decrypt(event) } class PrivateZapDecryptCache( signer: NostrSigner, -) : DecryptCache(signer) { +) : DecryptCache(signer) { override suspend fun decryptAndParse( event: ZapRequestEvent, signer: NostrSigner, - ): LnZapPrivateEvent = signer.decryptZapEvent(event) + ): PrivateZapEvent = signer.decryptZapEvent(event) } diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/LnZapPrivateEvent.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/PrivateZapEvent.kt similarity index 87% rename from quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/LnZapPrivateEvent.kt rename to quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/PrivateZapEvent.kt index 09c88dd2a3..163f2415a1 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/LnZapPrivateEvent.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/PrivateZapEvent.kt @@ -34,7 +34,7 @@ import com.vitorpamplona.quartz.nip01Core.tags.people.PTag import com.vitorpamplona.quartz.utils.TimeUtils @Immutable -class LnZapPrivateEvent( +class PrivateZapEvent( id: HexKey, pubKey: HexKey, createdAt: Long, @@ -66,13 +66,19 @@ class LnZapPrivateEvent( tags: Array> = emptyArray(), content: String = "", createdAt: Long = TimeUtils.now(), - ): LnZapPrivateEvent = signer.sign(createdAt, KIND, tags, content) + ): PrivateZapEvent = signer.sign(createdAt, KIND, tags, content) fun create( signer: NostrSignerSync, tags: Array> = emptyArray(), content: String = "", createdAt: Long = TimeUtils.now(), - ): LnZapPrivateEvent = signer.sign(createdAt, KIND, tags, content) + ): PrivateZapEvent = signer.sign(createdAt, KIND, tags, content) } } + +@Deprecated( + "Renamed to PrivateZapEvent. Follows the NIP-57 zap naming (ZapRequestEvent, ZapReceiptEvent).", + ReplaceWith("PrivateZapEvent", "com.vitorpamplona.quartz.nip57Zaps.PrivateZapEvent"), +) +typealias LnZapPrivateEvent = PrivateZapEvent diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/PrivateZapRequestBuilder.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/PrivateZapRequestBuilder.kt index 595dc24600..a26cc784bd 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/PrivateZapRequestBuilder.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/PrivateZapRequestBuilder.kt @@ -56,7 +56,7 @@ class PrivateZapRequestBuilder { val fullTagsNoAnon = tags.filter { t -> t.getOrNull(0) != "anon" }.toTypedArray() - val privateEvent = LnZapPrivateEvent.create(signer, fullTagsNoAnon, content) + val privateEvent = PrivateZapEvent.create(signer, fullTagsNoAnon, content) val noteJson = privateEvent.toJson() val encryptedContent = @@ -75,7 +75,7 @@ class PrivateZapRequestBuilder { fun decryptZapEvent( event: ZapRequestEvent, signer: NostrSignerSync, - ): LnZapPrivateEvent { + ): PrivateZapEvent { if (signer.keyPair.privKey == null) throw SignerExceptions.ReadOnlyException() val recipientPK = event.zappedAuthor().firstOrNull() @@ -129,12 +129,12 @@ class PrivateZapRequestBuilder { encNote: String, privateKey: ByteArray, pubKey: HexKey, - ): LnZapPrivateEvent = + ): PrivateZapEvent = try { val note = PrivateZapEncryption.decryptPrivateZapMessage(encNote, privateKey, pubKey.hexToByteArray()) val decryptedEvent = fromJson(note) if (decryptedEvent.kind == 9733) { - decryptedEvent as LnZapPrivateEvent + decryptedEvent as PrivateZapEvent } else { throw IllegalStateException("The decrypted event is not a private zap.") } diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/validate/LnurlEndpointResolver.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/validate/LnurlEndpointResolver.kt index 5b1841ada5..cb9cab5e9c 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/validate/LnurlEndpointResolver.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/validate/LnurlEndpointResolver.kt @@ -24,7 +24,7 @@ package com.vitorpamplona.quartz.nip57Zaps.validate * Resolves an LNURL-pay URL to its [LnurlEndpointInfo]. Implementations should * consult [LnurlEndpointCache] first and only fall through to a network fetch * on a miss. Lives in quartz so that pure-logic verifiers (e.g. - * [LnZapReceiptValidator]) can be wired against an abstract interface without + * [ZapReceiptValidator]) can be wired against an abstract interface without * depending on OkHttp. */ fun interface LnurlEndpointResolver { diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/validate/LnZapReceiptValidator.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/validate/ZapReceiptValidator.kt similarity index 95% rename from quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/validate/LnZapReceiptValidator.kt rename to quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/validate/ZapReceiptValidator.kt index da42cdb131..b7f812289d 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/validate/LnZapReceiptValidator.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip57Zaps/validate/ZapReceiptValidator.kt @@ -45,7 +45,7 @@ import com.vitorpamplona.quartz.utils.BigDecimal * check on the receipt's signer pubkey is non-negotiable when an * `expectedNostrPubkey` is provided. */ -object LnZapReceiptValidator { +object ZapReceiptValidator { sealed class Result { data object Valid : Result() @@ -153,3 +153,9 @@ object LnZapReceiptValidator { ?.get(1) ?.takeIf { it.isNotBlank() } } + +@Deprecated( + "Renamed to ZapReceiptValidator. Validates NIP-57 zap receipts (ZapReceiptEvent).", + ReplaceWith("ZapReceiptValidator", "com.vitorpamplona.quartz.nip57Zaps.validate.ZapReceiptValidator"), +) +typealias LnZapReceiptValidator = ZapReceiptValidator diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip89AppHandlers/clientTag/NostrSignerWithClientTag.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip89AppHandlers/clientTag/NostrSignerWithClientTag.kt index 48c72d8de2..3e9cd2ee4b 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip89AppHandlers/clientTag/NostrSignerWithClientTag.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip89AppHandlers/clientTag/NostrSignerWithClientTag.kt @@ -24,7 +24,7 @@ import com.vitorpamplona.quartz.nip01Core.core.Event import com.vitorpamplona.quartz.nip01Core.core.HexKey import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl import com.vitorpamplona.quartz.nip01Core.signers.NostrSigner -import com.vitorpamplona.quartz.nip57Zaps.LnZapPrivateEvent +import com.vitorpamplona.quartz.nip57Zaps.PrivateZapEvent import com.vitorpamplona.quartz.nip57Zaps.ZapRequestEvent /** @@ -94,7 +94,7 @@ class NostrSignerWithClientTag( fromPublicKey: HexKey, ): String = inner.nip44Decrypt(ciphertext, fromPublicKey) - override suspend fun decryptZapEvent(event: ZapRequestEvent): LnZapPrivateEvent = inner.decryptZapEvent(event) + override suspend fun decryptZapEvent(event: ZapRequestEvent): PrivateZapEvent = inner.decryptZapEvent(event) override suspend fun deriveKey(nonce: HexKey): HexKey = inner.deriveKey(nonce) diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/utils/EventFactory.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/utils/EventFactory.kt index d852130e87..06f5682286 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/utils/EventFactory.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/utils/EventFactory.kt @@ -261,21 +261,20 @@ import com.vitorpamplona.quartz.nip51Lists.appCurationSet.AppCurationSetEvent import com.vitorpamplona.quartz.nip51Lists.articleCurationSet.ArticleCurationSetEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.BookmarkListEvent import com.vitorpamplona.quartz.nip51Lists.bookmarkList.OldBookmarkListEvent +import com.vitorpamplona.quartz.nip51Lists.bookmarkSet.BookmarkSetEvent import com.vitorpamplona.quartz.nip51Lists.favoriteAlgoFeedsList.FavoriteAlgoFeedsListEvent -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.followSet.FollowSetEvent import com.vitorpamplona.quartz.nip51Lists.geohashList.GeohashListEvent import com.vitorpamplona.quartz.nip51Lists.gitAuthorList.GitAuthorListEvent import com.vitorpamplona.quartz.nip51Lists.gitRepositoryList.GitRepositoryListEvent import com.vitorpamplona.quartz.nip51Lists.goodWikiAuthorList.GoodWikiAuthorListEvent import com.vitorpamplona.quartz.nip51Lists.goodWikiRelayList.GoodWikiRelayListEvent -import com.vitorpamplona.quartz.nip51Lists.hashtagList.InterestListEvent +import com.vitorpamplona.quartz.nip51Lists.interestList.InterestListEvent import com.vitorpamplona.quartz.nip51Lists.interestSet.InterestSetEvent import com.vitorpamplona.quartz.nip51Lists.kindMuteSet.KindMuteSetEvent -import com.vitorpamplona.quartz.nip51Lists.labeledBookmarkList.BookmarkSetEvent import com.vitorpamplona.quartz.nip51Lists.mediaFollowList.MediaFollowListEvent import com.vitorpamplona.quartz.nip51Lists.mediaStarterPack.MediaStarterPackEvent import com.vitorpamplona.quartz.nip51Lists.muteList.MuteListEvent -import com.vitorpamplona.quartz.nip51Lists.peopleList.FollowSetEvent import com.vitorpamplona.quartz.nip51Lists.pictureCurationSet.PictureCurationSetEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.BlockedRelayListEvent import com.vitorpamplona.quartz.nip51Lists.relayLists.BroadcastRelayListEvent @@ -286,6 +285,7 @@ import com.vitorpamplona.quartz.nip51Lists.relayLists.TrustedRelayListEvent import com.vitorpamplona.quartz.nip51Lists.relaySets.RelaySetEvent import com.vitorpamplona.quartz.nip51Lists.releaseArtifactSet.ReleaseArtifactSetEvent import com.vitorpamplona.quartz.nip51Lists.simpleGroupList.SimpleGroupListEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import com.vitorpamplona.quartz.nip51Lists.videoCurationSet.VideoCurationSetEvent import com.vitorpamplona.quartz.nip52Calendar.appt.day.CalendarDateSlotEvent import com.vitorpamplona.quartz.nip52Calendar.appt.time.CalendarTimeSlotEvent @@ -304,7 +304,7 @@ import com.vitorpamplona.quartz.nip54Wiki.WikiMergeAcceptanceEvent import com.vitorpamplona.quartz.nip54Wiki.WikiMergeRequestEvent import com.vitorpamplona.quartz.nip54Wiki.WikiRedirectEvent import com.vitorpamplona.quartz.nip56Reports.ReportEvent -import com.vitorpamplona.quartz.nip57Zaps.LnZapPrivateEvent +import com.vitorpamplona.quartz.nip57Zaps.PrivateZapEvent import com.vitorpamplona.quartz.nip57Zaps.ZapReceiptEvent import com.vitorpamplona.quartz.nip57Zaps.ZapRequestEvent import com.vitorpamplona.quartz.nip58Badges.accepted.AcceptedBadgeSetEvent @@ -725,7 +725,7 @@ class EventFactory { NwcInfoEvent.KIND -> NwcInfoEvent(id, pubKey, createdAt, tags, content, sig) NwcNotificationEvent.KIND -> NwcNotificationEvent(id, pubKey, createdAt, tags, content, sig) NwcNotificationEvent.LEGACY_KIND -> NwcNotificationEvent(id, pubKey, createdAt, tags, content, sig) - LnZapPrivateEvent.KIND -> LnZapPrivateEvent(id, pubKey, createdAt, tags, content, sig) + PrivateZapEvent.KIND -> PrivateZapEvent(id, pubKey, createdAt, tags, content, sig) ZapRequestEvent.KIND -> ZapRequestEvent(id, pubKey, createdAt, tags, content, sig) LongFormContentEvent.KIND -> LongFormContentEvent(id, pubKey, createdAt, tags, content, sig) MarketplaceEvent.KIND -> MarketplaceEvent(id, pubKey, createdAt, tags, content, sig) diff --git a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/experimental/nip82SoftwareApps/SoftwareApplicationEventTest.kt b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/experimental/nip82SoftwareApps/SoftwareApplicationEventTest.kt index 25990b13ff..6f5166d193 100644 --- a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/experimental/nip82SoftwareApps/SoftwareApplicationEventTest.kt +++ b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/experimental/nip82SoftwareApps/SoftwareApplicationEventTest.kt @@ -207,6 +207,32 @@ class SoftwareApplicationEventTest { assertEquals("notes", template.content) } + @Test + fun searchIndex_includesReleaseNotesOnlyForNip82() { + val nip82 = + ReleaseArtifactSetEvent( + id = "0".repeat(64), + pubKey = "1".repeat(64), + createdAt = 0, + tags = arrayOf(arrayOf("d", "com.example.app@1.0.0"), arrayOf("i", "com.example.app"), arrayOf("version", "1.0.0")), + content = "Fixed the crash on startup", + sig = "", + ) + assertEquals("Fixed the crash on startup", nip82.indexableContent()) + + // A NIP-51 set can carry encrypted private items in content: never index it. + val nip51 = + ReleaseArtifactSetEvent( + id = "0".repeat(64), + pubKey = "1".repeat(64), + createdAt = 0, + tags = arrayOf(arrayOf("d", "some-uuid"), arrayOf("title", "My Release")), + content = "ciphertext?iv=abc", + sig = "", + ) + assertEquals("My Release", nip51.indexableContent()) + } + @Test fun parses_realWorldAmethystEvent() { // Real NIP-82 event published for Amethyst — used as a regression fixture so renderer diff --git a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/experimental/nip85TrustedAssertions/ContactCardPetNameTest.kt b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/experimental/nip85TrustedAssertions/UserAssertionPetNameTest.kt similarity index 99% rename from quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/experimental/nip85TrustedAssertions/ContactCardPetNameTest.kt rename to quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/experimental/nip85TrustedAssertions/UserAssertionPetNameTest.kt index 1f58771e64..fb330c5182 100644 --- a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/experimental/nip85TrustedAssertions/ContactCardPetNameTest.kt +++ b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/experimental/nip85TrustedAssertions/UserAssertionPetNameTest.kt @@ -32,7 +32,7 @@ import kotlin.test.assertEquals import kotlin.test.assertNull import kotlin.test.assertTrue -class ContactCardPetNameTest { +class UserAssertionPetNameTest { val signer = NostrSignerInternal(KeyPair()) val targetUser = "e88a691e98d9987c964521dff60025f60700378a4879180dcbbb4a5027850411" diff --git a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip01Core/store/sqlite/QueryAssemblerTest.kt b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip01Core/store/sqlite/QueryAssemblerTest.kt index 496def0887..9abb9aa952 100644 --- a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip01Core/store/sqlite/QueryAssemblerTest.kt +++ b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip01Core/store/sqlite/QueryAssemblerTest.kt @@ -980,7 +980,7 @@ class QueryAssemblerTest : BaseDBTest() { } @Test - fun testContactCardDownloadFromTrustedKeys() = + fun testUserAssertionDownloadFromTrustedKeys() = forEachDB { db -> val filter = Filter( diff --git a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip46RemoteSigner/server/BunkerRequestProcessorConcurrencyTest.kt b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip46RemoteSigner/server/BunkerRequestProcessorConcurrencyTest.kt index 5226a302ce..0a2bdce894 100644 --- a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip46RemoteSigner/server/BunkerRequestProcessorConcurrencyTest.kt +++ b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip46RemoteSigner/server/BunkerRequestProcessorConcurrencyTest.kt @@ -30,7 +30,7 @@ import com.vitorpamplona.quartz.nip46RemoteSigner.BunkerRequestConnect import com.vitorpamplona.quartz.nip46RemoteSigner.BunkerRequestSign import com.vitorpamplona.quartz.nip46RemoteSigner.BunkerResponse import com.vitorpamplona.quartz.nip46RemoteSigner.BunkerResponseEvent -import com.vitorpamplona.quartz.nip57Zaps.LnZapPrivateEvent +import com.vitorpamplona.quartz.nip57Zaps.PrivateZapEvent import com.vitorpamplona.quartz.nip57Zaps.ZapRequestEvent import kotlinx.coroutines.CompletableDeferred import kotlinx.coroutines.launch @@ -101,7 +101,7 @@ class BunkerRequestProcessorConcurrencyTest { fromPublicKey: HexKey, ) = "" - override suspend fun decryptZapEvent(event: ZapRequestEvent): LnZapPrivateEvent = throw NotImplementedError() + override suspend fun decryptZapEvent(event: ZapRequestEvent): PrivateZapEvent = throw NotImplementedError() override suspend fun deriveKey(nonce: HexKey): HexKey = throw NotImplementedError() diff --git a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip46RemoteSigner/server/BunkerRequestProcessorTest.kt b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip46RemoteSigner/server/BunkerRequestProcessorTest.kt index bc5598a518..ea7339b628 100644 --- a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip46RemoteSigner/server/BunkerRequestProcessorTest.kt +++ b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip46RemoteSigner/server/BunkerRequestProcessorTest.kt @@ -40,7 +40,7 @@ import com.vitorpamplona.quartz.nip46RemoteSigner.BunkerResponseEvent import com.vitorpamplona.quartz.nip46RemoteSigner.BunkerResponseGetRelays import com.vitorpamplona.quartz.nip46RemoteSigner.BunkerResponsePong import com.vitorpamplona.quartz.nip46RemoteSigner.BunkerResponsePublicKey -import com.vitorpamplona.quartz.nip57Zaps.LnZapPrivateEvent +import com.vitorpamplona.quartz.nip57Zaps.PrivateZapEvent import com.vitorpamplona.quartz.nip57Zaps.ZapRequestEvent import kotlinx.coroutines.test.runTest import kotlin.test.Test @@ -116,7 +116,7 @@ class BunkerRequestProcessorTest { return "nip44dec:$ciphertext" } - override suspend fun decryptZapEvent(event: ZapRequestEvent): LnZapPrivateEvent = throw NotImplementedError() + override suspend fun decryptZapEvent(event: ZapRequestEvent): PrivateZapEvent = throw NotImplementedError() override suspend fun deriveKey(nonce: HexKey): HexKey = throw NotImplementedError() @@ -371,7 +371,7 @@ class BunkerRequestProcessorTest { fromPublicKey: HexKey, ) = "" - override suspend fun decryptZapEvent(event: ZapRequestEvent): LnZapPrivateEvent = throw NotImplementedError() + override suspend fun decryptZapEvent(event: ZapRequestEvent): PrivateZapEvent = throw NotImplementedError() override suspend fun deriveKey(nonce: HexKey): HexKey = throw NotImplementedError() diff --git a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip46RemoteSigner/server/NostrConnectSignerServiceTest.kt b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip46RemoteSigner/server/NostrConnectSignerServiceTest.kt index 0e631bc3e1..db6c888430 100644 --- a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip46RemoteSigner/server/NostrConnectSignerServiceTest.kt +++ b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip46RemoteSigner/server/NostrConnectSignerServiceTest.kt @@ -38,7 +38,7 @@ import com.vitorpamplona.quartz.nip46RemoteSigner.BunkerResponse import com.vitorpamplona.quartz.nip46RemoteSigner.BunkerResponseEvent import com.vitorpamplona.quartz.nip46RemoteSigner.BunkerResponsePublicKey import com.vitorpamplona.quartz.nip46RemoteSigner.NostrConnectEvent -import com.vitorpamplona.quartz.nip57Zaps.LnZapPrivateEvent +import com.vitorpamplona.quartz.nip57Zaps.PrivateZapEvent import com.vitorpamplona.quartz.nip57Zaps.ZapRequestEvent import com.vitorpamplona.quartz.utils.RandomInstance import com.vitorpamplona.quartz.utils.TimeUtils @@ -112,7 +112,7 @@ class NostrConnectSignerServiceTest { fromPublicKey: HexKey, ) = ciphertext - override suspend fun decryptZapEvent(event: ZapRequestEvent): LnZapPrivateEvent = throw NotImplementedError() + override suspend fun decryptZapEvent(event: ZapRequestEvent): PrivateZapEvent = throw NotImplementedError() override suspend fun deriveKey(nonce: HexKey): HexKey = throw NotImplementedError() diff --git a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip47WalletConnect/LnZapPaymentRequestNip44EventTest.kt b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip47WalletConnect/NwcRequestNip44EventTest.kt similarity index 98% rename from quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip47WalletConnect/LnZapPaymentRequestNip44EventTest.kt rename to quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip47WalletConnect/NwcRequestNip44EventTest.kt index edc3143ba5..1a6c7ae24f 100644 --- a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip47WalletConnect/LnZapPaymentRequestNip44EventTest.kt +++ b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip47WalletConnect/NwcRequestNip44EventTest.kt @@ -32,7 +32,7 @@ import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertIs -class LnZapPaymentRequestNip44EventTest { +class NwcRequestNip44EventTest { @Test fun testCreateRequestWithNip44() = runTest { diff --git a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip50Search/SearchFieldExtractorTest.kt b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip50Search/SearchFieldExtractorTest.kt index 5d044ecb52..51b77ca13f 100644 --- a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip50Search/SearchFieldExtractorTest.kt +++ b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip50Search/SearchFieldExtractorTest.kt @@ -153,7 +153,7 @@ class SearchFieldExtractorTest { } @Test - fun contactCardsDecomposeIntoPetnameSummaryAndTopics() { + fun userAssertionsDecomposeIntoPetnameSummaryAndTopics() { // A provider's petname for a person is that provider's NAME for them, // so it lands where kind 0's name does. topics() reads `t` tags, so // the tiers() funnel carries them once, as hashtags. @@ -177,7 +177,7 @@ class SearchFieldExtractorTest { } @Test - fun contactCardsCarryTopicsEvenWithNoPublicPetname() { + fun userAssertionsCarryTopicsEvenWithNoPublicPetname() { // THE SHAPE THIS LIBRARY ITSELF PUBLISHES: build() puts petname and // summary in the NIP-44 content, so a card's only public text is its // topics. They must still reach the backend -- through the hashtag @@ -189,7 +189,7 @@ class SearchFieldExtractorTest { } @Test - fun contactCardsWithNoPublicTextExtractNothing() { + fun userAssertionsWithNoPublicTextExtractNothing() { // The petname and summary of a private card live in the NIP-44 // encrypted content, which is never indexed -- so a card carrying only // scores has nothing to search. diff --git a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip51Lists/relayLists/RelayListPublicEntriesTest.kt b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip51Lists/relayLists/RelayListPublicEntriesTest.kt index 5111ca4c15..484ecb6f2f 100644 --- a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip51Lists/relayLists/RelayListPublicEntriesTest.kt +++ b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip51Lists/relayLists/RelayListPublicEntriesTest.kt @@ -60,7 +60,7 @@ class RelayListPublicEntriesTest { ) @Test - fun relayFeedsListKeepsTheSurvivorPublic() = + fun favoriteRelayListKeepsTheSurvivorPublic() = runTest { val before = publicListFromAnotherClient(FavoriteRelayListEvent.KIND) val after = FavoriteRelayListEvent.updateRelayList(before, listOf(damus), signer, 1740669817) diff --git a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip57Zaps/LnZapRequestAnonTagTest.kt b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip57Zaps/ZapRequestAnonTagTest.kt similarity index 99% rename from quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip57Zaps/LnZapRequestAnonTagTest.kt rename to quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip57Zaps/ZapRequestAnonTagTest.kt index 9592029d3c..8bf0e14306 100644 --- a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip57Zaps/LnZapRequestAnonTagTest.kt +++ b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip57Zaps/ZapRequestAnonTagTest.kt @@ -37,7 +37,7 @@ import kotlin.test.assertTrue * (encrypted `anon`) requests use throwaway keys — tagging anything derived * from them is either useless or, for the decrypted sender, a doxxing risk. */ -class LnZapRequestAnonTagTest { +class ZapRequestAnonTagTest { private val signer = NostrSignerInternal( "nsec10g0wheggqn9dawlc0yuv6adnat6n09anr7eyykevw2dm8xa5fffs0wsdsr".nsecToKeyPair(), diff --git a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip57Zaps/LnZapRequestGroupTagTest.kt b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip57Zaps/ZapRequestGroupTagTest.kt similarity index 99% rename from quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip57Zaps/LnZapRequestGroupTagTest.kt rename to quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip57Zaps/ZapRequestGroupTagTest.kt index 07451237b4..14bce2e8e9 100644 --- a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip57Zaps/LnZapRequestGroupTagTest.kt +++ b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip57Zaps/ZapRequestGroupTagTest.kt @@ -39,7 +39,7 @@ import kotlin.test.assertTrue * their rooms) never matches it — so a zap on a group message would be invisible exactly where it was * meant to be seen. Reactions already copy the tag (`ReactionAction`); this pins the same rule for zaps. */ -class LnZapRequestGroupTagTest { +class ZapRequestGroupTagTest { private val signer = DeterministicSigner( "nsec10g0wheggqn9dawlc0yuv6adnat6n09anr7eyykevw2dm8xa5fffs0wsdsr".nsecToKeyPair(), diff --git a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip57Zaps/LnZapRequestKindTagTest.kt b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip57Zaps/ZapRequestKindTagTest.kt similarity index 99% rename from quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip57Zaps/LnZapRequestKindTagTest.kt rename to quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip57Zaps/ZapRequestKindTagTest.kt index 1ba8c3c279..38e125424d 100644 --- a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip57Zaps/LnZapRequestKindTagTest.kt +++ b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip57Zaps/ZapRequestKindTagTest.kt @@ -32,7 +32,7 @@ import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertTrue -class LnZapRequestKindTagTest { +class ZapRequestKindTagTest { private val signer = DeterministicSigner( "nsec10g0wheggqn9dawlc0yuv6adnat6n09anr7eyykevw2dm8xa5fffs0wsdsr".nsecToKeyPair(), diff --git a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip57Zaps/validate/LnZapReceiptValidatorTest.kt b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip57Zaps/validate/ZapReceiptValidatorTest.kt similarity index 70% rename from quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip57Zaps/validate/LnZapReceiptValidatorTest.kt rename to quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip57Zaps/validate/ZapReceiptValidatorTest.kt index ef3344b0b0..5487d552e0 100644 --- a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip57Zaps/validate/LnZapReceiptValidatorTest.kt +++ b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/nip57Zaps/validate/ZapReceiptValidatorTest.kt @@ -26,7 +26,7 @@ import kotlin.test.assertEquals import kotlin.test.assertIs import kotlin.test.assertTrue -class LnZapReceiptValidatorTest { +class ZapReceiptValidatorTest { // Mainnet 100,000 sat invoice (= 100_000_000 msats). From LnInvoiceUtilTest. private val invoice100kSats = "lnbc1m1pjt9u0qsp553q90pj5mafzv20w45eqavned9tgwhl4q99n9s5ppcw24nzw3zeqpp5002kd3ktym67du86kj665fgaev7ka8ys7j5yz5fg686lr5e2gfkshp5dkk27nnuax05az3pk2r6ytxtvwn5j4xzsq9ajprhc7crjkmgvr3qxqyjw5qcqpjrzjqtzxvfsuxe4l92pf97tt4rcgpy2xalkmlwexh899wqxf83l8nwv4xzh0gvqq89qqqqqqqqlgqqqqq0gqvs9qxpqysgqx5mz04wd7kqu5zhhel9enr036hjrp4gga0nz084p2asjl36a0zmrk6mhqa249zsgqref2rlvhffm73u7rxgr47gden6rugup4ksvpzsqvds4pz" @@ -80,99 +80,99 @@ class LnZapReceiptValidatorTest { @Test fun `valid receipt passes all checks`() { - val result = LnZapReceiptValidator.validate(receipt(), providerPubkey, lnurlOfRecipient) - assertEquals(LnZapReceiptValidator.Result.Valid, result) + val result = ZapReceiptValidator.validate(receipt(), providerPubkey, lnurlOfRecipient) + assertEquals(ZapReceiptValidator.Result.Valid, result) } @Test fun `missing zap request fails with MISSING_ZAP_REQUEST`() { val r = receipt(description = null) - val result = LnZapReceiptValidator.validate(r, providerPubkey, lnurlOfRecipient) - val invalid = assertIs(result) - assertEquals(LnZapReceiptValidator.Result.Reason.MISSING_ZAP_REQUEST, invalid.reason) + val result = ZapReceiptValidator.validate(r, providerPubkey, lnurlOfRecipient) + val invalid = assertIs(result) + assertEquals(ZapReceiptValidator.Result.Reason.MISSING_ZAP_REQUEST, invalid.reason) } @Test fun `wrong signer fails with MISMATCHED_NOSTR_PUBKEY`() { val attackerPubkey = "1".repeat(64) - val result = LnZapReceiptValidator.validate(receipt(signerPubkey = attackerPubkey), providerPubkey, lnurlOfRecipient) - val invalid = assertIs(result) - assertEquals(LnZapReceiptValidator.Result.Reason.MISMATCHED_NOSTR_PUBKEY, invalid.reason) + val result = ZapReceiptValidator.validate(receipt(signerPubkey = attackerPubkey), providerPubkey, lnurlOfRecipient) + val invalid = assertIs(result) + assertEquals(ZapReceiptValidator.Result.Reason.MISMATCHED_NOSTR_PUBKEY, invalid.reason) } @Test fun `null expected pubkey skips the check`() { val attackerPubkey = "1".repeat(64) - val result = LnZapReceiptValidator.validate(receipt(signerPubkey = attackerPubkey), null, lnurlOfRecipient) - assertEquals(LnZapReceiptValidator.Result.Valid, result) + val result = ZapReceiptValidator.validate(receipt(signerPubkey = attackerPubkey), null, lnurlOfRecipient) + assertEquals(ZapReceiptValidator.Result.Valid, result) } @Test fun `missing bolt11 fails with MISSING_OR_BAD_BOLT11`() { - val result = LnZapReceiptValidator.validate(receipt(bolt11 = null), providerPubkey, lnurlOfRecipient) - val invalid = assertIs(result) - assertEquals(LnZapReceiptValidator.Result.Reason.MISSING_OR_BAD_BOLT11, invalid.reason) + val result = ZapReceiptValidator.validate(receipt(bolt11 = null), providerPubkey, lnurlOfRecipient) + val invalid = assertIs(result) + assertEquals(ZapReceiptValidator.Result.Reason.MISSING_OR_BAD_BOLT11, invalid.reason) } @Test fun `mismatched amount fails with MISMATCHED_AMOUNT`() { // bolt11 is 100,000,000 msats; request claims 50,000,000. val r = receipt(description = zapRequestJson(amountMillisats = 50_000_000L)) - val result = LnZapReceiptValidator.validate(r, providerPubkey, lnurlOfRecipient) - val invalid = assertIs(result) - assertEquals(LnZapReceiptValidator.Result.Reason.MISMATCHED_AMOUNT, invalid.reason) + val result = ZapReceiptValidator.validate(r, providerPubkey, lnurlOfRecipient) + val invalid = assertIs(result) + assertEquals(ZapReceiptValidator.Result.Reason.MISMATCHED_AMOUNT, invalid.reason) } @Test fun `missing amount tag is accepted when not strict`() { val r = receipt(description = zapRequestJson(amountMillisats = null)) - val result = LnZapReceiptValidator.validate(r, providerPubkey, lnurlOfRecipient, strictAmount = false) - assertEquals(LnZapReceiptValidator.Result.Valid, result) + val result = ZapReceiptValidator.validate(r, providerPubkey, lnurlOfRecipient, strictAmount = false) + assertEquals(ZapReceiptValidator.Result.Valid, result) } @Test fun `missing amount tag fails when strict`() { val r = receipt(description = zapRequestJson(amountMillisats = null)) - val result = LnZapReceiptValidator.validate(r, providerPubkey, lnurlOfRecipient, strictAmount = true) - val invalid = assertIs(result) - assertEquals(LnZapReceiptValidator.Result.Reason.MISMATCHED_AMOUNT, invalid.reason) + val result = ZapReceiptValidator.validate(r, providerPubkey, lnurlOfRecipient, strictAmount = true) + val invalid = assertIs(result) + assertEquals(ZapReceiptValidator.Result.Reason.MISMATCHED_AMOUNT, invalid.reason) } @Test fun `mismatched lnurl fails with MISMATCHED_LNURL`() { val r = receipt(description = zapRequestJson(lnurl = "other@example.org")) - val result = LnZapReceiptValidator.validate(r, providerPubkey, lnurlOfRecipient) - val invalid = assertIs(result) - assertEquals(LnZapReceiptValidator.Result.Reason.MISMATCHED_LNURL, invalid.reason) + val result = ZapReceiptValidator.validate(r, providerPubkey, lnurlOfRecipient) + val invalid = assertIs(result) + assertEquals(ZapReceiptValidator.Result.Reason.MISMATCHED_LNURL, invalid.reason) } @Test fun `missing lnurl tag is accepted`() { val r = receipt(description = zapRequestJson(lnurl = null)) - val result = LnZapReceiptValidator.validate(r, providerPubkey, lnurlOfRecipient) - assertEquals(LnZapReceiptValidator.Result.Valid, result) + val result = ZapReceiptValidator.validate(r, providerPubkey, lnurlOfRecipient) + assertEquals(ZapReceiptValidator.Result.Valid, result) } @Test fun `lnurl tag in URL form matches lud16 expectation`() { val r = receipt(description = zapRequestJson(lnurl = lnurlUrl)) - val result = LnZapReceiptValidator.validate(r, providerPubkey, lnurlOfRecipient) - assertEquals(LnZapReceiptValidator.Result.Valid, result) + val result = ZapReceiptValidator.validate(r, providerPubkey, lnurlOfRecipient) + assertEquals(ZapReceiptValidator.Result.Valid, result) } @Test fun `lnurl tag in bech32 form matches lud16 expectation`() { val bech32 = LnurlForm.urlToBech32(lnurlUrl) val r = receipt(description = zapRequestJson(lnurl = bech32)) - val result = LnZapReceiptValidator.validate(r, providerPubkey, lnurlOfRecipient) - assertEquals(LnZapReceiptValidator.Result.Valid, result) + val result = ZapReceiptValidator.validate(r, providerPubkey, lnurlOfRecipient) + assertEquals(ZapReceiptValidator.Result.Valid, result) } @Test fun `pubkey check is case-insensitive`() { val r = receipt(signerPubkey = providerPubkey.uppercase()) - val result = LnZapReceiptValidator.validate(r, providerPubkey, lnurlOfRecipient) - assertEquals(LnZapReceiptValidator.Result.Valid, result) + val result = ZapReceiptValidator.validate(r, providerPubkey, lnurlOfRecipient) + assertEquals(ZapReceiptValidator.Result.Valid, result) } } diff --git a/quartz/src/jvmAndroidTest/kotlin/com/vitorpamplona/quartz/nip01Core/jackson/JacksonMapperTest.kt b/quartz/src/jvmAndroidTest/kotlin/com/vitorpamplona/quartz/nip01Core/jackson/JacksonMapperTest.kt index 76022f4303..6460a74a65 100644 --- a/quartz/src/jvmAndroidTest/kotlin/com/vitorpamplona/quartz/nip01Core/jackson/JacksonMapperTest.kt +++ b/quartz/src/jvmAndroidTest/kotlin/com/vitorpamplona/quartz/nip01Core/jackson/JacksonMapperTest.kt @@ -23,7 +23,7 @@ package com.vitorpamplona.quartz.nip01Core.jackson import com.vitorpamplona.quartz.nip01Core.core.Event import com.vitorpamplona.quartz.nip01Core.relay.filters.Filter import com.vitorpamplona.quartz.nip01Core.signers.EventTemplate -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import com.vitorpamplona.quartz.nip59Giftwrap.rumors.Rumor import kotlin.test.Test import kotlin.test.assertContentEquals diff --git a/quartz/src/jvmAndroidTest/kotlin/com/vitorpamplona/quartz/nip01Core/kotlinSerialization/KotlinSerializationMapperTest.kt b/quartz/src/jvmAndroidTest/kotlin/com/vitorpamplona/quartz/nip01Core/kotlinSerialization/KotlinSerializationMapperTest.kt index a3ee938277..f33431cd8f 100644 --- a/quartz/src/jvmAndroidTest/kotlin/com/vitorpamplona/quartz/nip01Core/kotlinSerialization/KotlinSerializationMapperTest.kt +++ b/quartz/src/jvmAndroidTest/kotlin/com/vitorpamplona/quartz/nip01Core/kotlinSerialization/KotlinSerializationMapperTest.kt @@ -39,7 +39,7 @@ import com.vitorpamplona.quartz.nip01Core.relay.filters.Filter import com.vitorpamplona.quartz.nip01Core.signers.EventTemplate import com.vitorpamplona.quartz.nip46RemoteSigner.BunkerRequest import com.vitorpamplona.quartz.nip46RemoteSigner.BunkerResponse -import com.vitorpamplona.quartz.nip51Lists.followList.StarterPackEvent +import com.vitorpamplona.quartz.nip51Lists.starterPack.StarterPackEvent import com.vitorpamplona.quartz.nip59Giftwrap.rumors.Rumor import kotlin.test.Test import kotlin.test.assertContentEquals