mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-27 22:46:22 +02:00
add relay info
This commit is contained in:
@@ -24,6 +24,8 @@ import com.vitorpamplona.amethyst.model.Account
|
|||||||
import com.vitorpamplona.amethyst.model.LocalCache
|
import com.vitorpamplona.amethyst.model.LocalCache
|
||||||
import com.vitorpamplona.amethyst.model.Note
|
import com.vitorpamplona.amethyst.model.Note
|
||||||
import com.vitorpamplona.amethyst.model.User
|
import com.vitorpamplona.amethyst.model.User
|
||||||
|
import com.vitorpamplona.ammolite.relays.FeedType
|
||||||
|
import com.vitorpamplona.ammolite.relays.Relay
|
||||||
|
|
||||||
class UserProfileGalleryFeedFilter(
|
class UserProfileGalleryFeedFilter(
|
||||||
val user: User,
|
val user: User,
|
||||||
@@ -36,7 +38,7 @@ class UserProfileGalleryFeedFilter(
|
|||||||
user.latestGalleryList
|
user.latestGalleryList
|
||||||
?.taggedGalleryEntries()
|
?.taggedGalleryEntries()
|
||||||
?.map {
|
?.map {
|
||||||
Pair(
|
Triple(
|
||||||
// (
|
// (
|
||||||
// if (ATag.isATag(it.id)) {
|
// if (ATag.isATag(it.id)) {
|
||||||
// ATag.parse(it.id, null)?.let { it1 -> LocalCache.getOrCreateAddressableNote(it1) }
|
// ATag.parse(it.id, null)?.let { it1 -> LocalCache.getOrCreateAddressableNote(it1) }
|
||||||
@@ -45,6 +47,7 @@ class UserProfileGalleryFeedFilter(
|
|||||||
// }
|
// }
|
||||||
// )!!
|
// )!!
|
||||||
it.url,
|
it.url,
|
||||||
|
it.relay,
|
||||||
)
|
)
|
||||||
}?.toSet()
|
}?.toSet()
|
||||||
?: emptySet()
|
?: emptySet()
|
||||||
@@ -52,6 +55,11 @@ class UserProfileGalleryFeedFilter(
|
|||||||
var finalnotes = setOf<Note>()
|
var finalnotes = setOf<Note>()
|
||||||
for (pair in notes) {
|
for (pair in notes) {
|
||||||
pair.first.headerImage = pair.second
|
pair.first.headerImage = pair.second
|
||||||
|
if (pair.third != null) {
|
||||||
|
val relay = Relay(pair.third!!, true, false, setOf(FeedType.GLOBAL))
|
||||||
|
pair.first.createdAt()?.let { user.addRelayBeingUsed(relay, it) }
|
||||||
|
pair.first.addRelay(relay)
|
||||||
|
}
|
||||||
finalnotes = finalnotes + pair.first
|
finalnotes = finalnotes + pair.first
|
||||||
}
|
}
|
||||||
println(finalnotes)
|
println(finalnotes)
|
||||||
|
Reference in New Issue
Block a user