Add FollowSet class, and property in User.

This commit is contained in:
KotlinGeekDev
2024-10-26 13:15:43 +01:00
parent c79157f415
commit afca104b87
2 changed files with 13 additions and 1 deletions
@@ -42,6 +42,7 @@ import com.vitorpamplona.quartz.events.ChatroomKey
import com.vitorpamplona.quartz.events.ContactListEvent
import com.vitorpamplona.quartz.events.LnZapEvent
import com.vitorpamplona.quartz.events.MetadataEvent
import com.vitorpamplona.quartz.events.PeopleListEvent
import com.vitorpamplona.quartz.events.ReportEvent
import com.vitorpamplona.quartz.events.UserMetadata
import com.vitorpamplona.quartz.events.toImmutableListOfLists
@@ -60,6 +61,7 @@ class User(
var latestMetadataRelay: String? = null
var latestContactList: ContactListEvent? = null
var latestBookmarkList: BookmarkListEvent? = null
var followSets: Map<String, PeopleListEvent> = emptyMap()
var reports = mapOf<User, Set<Note>>()
private set
@@ -438,16 +440,19 @@ class UserFlowSet(
val metadata = UserBundledRefresherFlow(u)
val follows = UserBundledRefresherFlow(u)
val relays = UserBundledRefresherFlow(u)
val followSets = UserBundledRefresherFlow(u)
fun isInUse(): Boolean =
metadata.stateFlow.subscriptionCount.value > 0 ||
relays.stateFlow.subscriptionCount.value > 0 ||
follows.stateFlow.subscriptionCount.value > 0
follows.stateFlow.subscriptionCount.value > 0 ||
followSets.stateFlow.subscriptionCount.value > 0
fun destroy() {
metadata.destroy()
relays.destroy()
follows.destroy()
followSets.destroy()
}
}
@@ -76,6 +76,13 @@ class PeopleListEvent(
}
}
class FollowSet(
val isPrivate: Boolean,
val title: String,
val description: String?,
val profileList: Set<String>,
)
@Immutable
class UsersAndWords(
val users: Set<String> = setOf(),