Improves starting value of flows

This commit is contained in:
Vitor Pamplona
2025-07-02 12:51:08 -04:00
parent bb55aea4a4
commit ce7965d00e
18 changed files with 101 additions and 42 deletions
@@ -41,19 +41,19 @@ class MuteListEvent(
) : GeneralListEvent(id, pubKey, createdAt, KIND, tags, content, sig) {
override fun dTag() = FIXED_D_TAG
fun publicUsersAndWords() =
PeopleListEvent.UsersAndWords(
filterTagList("p", tags),
filterTagList("word", tags),
fun publicAndCachedUsersAndWords() =
UsersAndWords(
filterTagList("p", cachedPrivateTags()),
filterTagList("word", cachedPrivateTags()),
)
fun publicAndPrivateUsersAndWords(
signer: NostrSigner,
onReady: (PeopleListEvent.UsersAndWords) -> Unit,
onReady: (UsersAndWords) -> Unit,
) {
privateTagsOrEmpty(signer) {
onReady(
PeopleListEvent.UsersAndWords(
UsersAndWords(
filterTagList("p", it),
filterTagList("word", it),
),
@@ -44,10 +44,10 @@ class PeopleListEvent(
val words: Set<String> = setOf(),
)
fun publicUsersAndWords() =
fun publicAndCachedPrivateUsersAndWords() =
UsersAndWords(
filterTagList("p", tags),
filterTagList("word", tags),
filterTagList("p", cachedPrivateTags()),
filterTagList("word", cachedPrivateTags()),
)
fun publicAndPrivateUsersAndWords(
@@ -46,6 +46,8 @@ class HashtagListEvent(
fun publicHashtags() = tags.mapNotNull(HashtagTag::parse)
fun publicAndCachedPrivateHashtags() = publicHashtags().toSet() + (publicAndPrivateHashtagCache ?: emptySet())
fun publicAndPrivateHashtag(
signer: NostrSigner,
onReady: (Set<String>) -> Unit,
@@ -47,6 +47,8 @@ class GeohashListEvent(
fun publicGeohashes() = tags.mapNotNull(GeoHashTag::parse)
fun publicAndCachedPrivateGeohash() = publicGeohashes().toSet() + (publicAndPrivateGeohashCache ?: emptySet())
fun publicAndPrivateGeohash(
signer: NostrSigner,
onReady: (Set<String>) -> Unit,
@@ -54,6 +54,8 @@ class CommunityListEvent(
fun publicCommunityIds() = tags.mapNotNull(ATag::parseAddressId)
fun publicAndCachedPrivateCommunityIds() = publicCommunityIds() + (publicAndPrivateAddressCache?.map { it.addressId } ?: emptyList())
fun publicAndPrivateCommunities(
signer: NostrSigner,
onReady: (Set<AddressHint>) -> Unit,