mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-10-10 23:14:13 +02:00
updates the EOSE of users even if no user is found in the relay.
This commit is contained in:
@@ -320,7 +320,7 @@ fun groupByEOSEPresence(notes: Set<Note>): Collection<List<Note>> =
|
|||||||
.joinToString(",")
|
.joinToString(",")
|
||||||
}.values
|
}.values
|
||||||
.map {
|
.map {
|
||||||
it.sortedBy { it.idHex }
|
it.sortedBy { it.idHex } // important to keep in order otherwise the Relay thinks the filter has changed and we REQ again
|
||||||
}
|
}
|
||||||
|
|
||||||
fun groupByEOSEPresence(users: Iterable<User>): Collection<List<User>> =
|
fun groupByEOSEPresence(users: Iterable<User>): Collection<List<User>> =
|
||||||
@@ -331,7 +331,7 @@ fun groupByEOSEPresence(users: Iterable<User>): Collection<List<User>> =
|
|||||||
.joinToString(",")
|
.joinToString(",")
|
||||||
}.values
|
}.values
|
||||||
.map {
|
.map {
|
||||||
it.sortedBy { it.pubkeyHex }
|
it.sortedBy { it.pubkeyHex } // important to keep in order otherwise the Relay thinks the filter has changed and we REQ again
|
||||||
}
|
}
|
||||||
|
|
||||||
fun findMinimumEOSEs(notes: List<Note>): Map<String, EOSETime> {
|
fun findMinimumEOSEs(notes: List<Note>): Map<String, EOSETime> {
|
||||||
|
@@ -64,6 +64,7 @@ object NostrSingleUserDataSource : AmethystNostrDataSource("SingleUserFeed") {
|
|||||||
.map { group ->
|
.map { group ->
|
||||||
val groupIds = group.map { it.pubkeyHex }
|
val groupIds = group.map { it.pubkeyHex }
|
||||||
val minEOSEs = findMinimumEOSEsForUsers(group)
|
val minEOSEs = findMinimumEOSEsForUsers(group)
|
||||||
|
|
||||||
listOf(
|
listOf(
|
||||||
TypedFilter(
|
TypedFilter(
|
||||||
types = EVENT_FINDER_TYPES,
|
types = EVENT_FINDER_TYPES,
|
||||||
@@ -92,7 +93,6 @@ object NostrSingleUserDataSource : AmethystNostrDataSource("SingleUserFeed") {
|
|||||||
checkNotInMainThread()
|
checkNotInMainThread()
|
||||||
|
|
||||||
usersToWatch.forEach {
|
usersToWatch.forEach {
|
||||||
if (it.latestMetadata != null) {
|
|
||||||
val eose = it.latestEOSEs[relayUrl]
|
val eose = it.latestEOSEs[relayUrl]
|
||||||
if (eose == null) {
|
if (eose == null) {
|
||||||
it.latestEOSEs = it.latestEOSEs + Pair(relayUrl, EOSETime(time))
|
it.latestEOSEs = it.latestEOSEs + Pair(relayUrl, EOSETime(time))
|
||||||
@@ -101,7 +101,6 @@ object NostrSingleUserDataSource : AmethystNostrDataSource("SingleUserFeed") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
override fun updateChannelFilters() {
|
override fun updateChannelFilters() {
|
||||||
checkNotInMainThread()
|
checkNotInMainThread()
|
||||||
|
Reference in New Issue
Block a user