mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-19 18:21:45 +02:00
- Only shows live stream bubbles that are not 24/7
- Only shows user pictures of the active users in the past 15 minutes.
This commit is contained in:
@@ -48,7 +48,15 @@ abstract class Channel : NotesGatherer {
|
||||
return new
|
||||
}
|
||||
|
||||
open fun participatingAuthors() = notes.mapNotNull { key, value -> value.author }
|
||||
open fun participatingAuthors(maxTimeLimit: Long) =
|
||||
notes.mapNotNull { key, value ->
|
||||
val createdAt = value.createdAt()
|
||||
if (createdAt != null && createdAt > maxTimeLimit) {
|
||||
value.author
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
abstract fun toBestDisplayName(): String
|
||||
|
||||
|
@@ -32,6 +32,7 @@ import com.vitorpamplona.amethyst.model.nip28PublicChats.PublicChatChannel
|
||||
import com.vitorpamplona.amethyst.model.nip53LiveActivities.LiveActivitiesChannel
|
||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
||||
import com.vitorpamplona.quartz.nip53LiveActivities.streaming.LiveActivitiesEvent
|
||||
import com.vitorpamplona.quartz.utils.TimeUtils
|
||||
import kotlinx.collections.immutable.ImmutableList
|
||||
import kotlinx.collections.immutable.persistentListOf
|
||||
import kotlinx.collections.immutable.toImmutableList
|
||||
@@ -85,10 +86,11 @@ fun observeChannelNoteAuthors(
|
||||
private fun channelToParticipatingUsers(
|
||||
channel: Channel,
|
||||
accountViewModel: AccountViewModel,
|
||||
maxTimeLimit: Long = TimeUtils.fifteenMinutesAgo(),
|
||||
): ImmutableList<User> {
|
||||
val users = mutableSetOf<User>()
|
||||
|
||||
channel.participatingAuthors().forEach {
|
||||
channel.participatingAuthors(maxTimeLimit).forEach {
|
||||
users.add(it)
|
||||
}
|
||||
|
||||
|
@@ -88,7 +88,9 @@ class HomeLiveFilter(
|
||||
): Boolean {
|
||||
val liveChannel =
|
||||
channel.info?.let {
|
||||
val startedAt = it.starts()
|
||||
it.createdAt > timeLimit &&
|
||||
(startedAt == null || (it.createdAt - startedAt) < TimeUtils.ONE_DAY) &&
|
||||
it.status() == StatusTag.STATUS.LIVE &&
|
||||
filterParams.match(it, channel.relays().toList())
|
||||
}
|
||||
|
Reference in New Issue
Block a user