mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-06-30 01:20:40 +02:00
Start of the work to have following since <date>
This commit is contained in:
@ -144,7 +144,7 @@ object LocalCache {
|
|||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
}.filterNotNull(),
|
}.filterNotNull().toSet(),
|
||||||
event.createdAt
|
event.createdAt
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ class User(val pubkey: ByteArray) {
|
|||||||
return info.picture ?: "https://robohash.org/${pubkeyHex}.png"
|
return info.picture ?: "https://robohash.org/${pubkeyHex}.png"
|
||||||
}
|
}
|
||||||
|
|
||||||
fun follow(user: User) {
|
fun follow(user: User, followedAt: Long) {
|
||||||
follows.add(user)
|
follows.add(user)
|
||||||
user.followers.add(this)
|
user.followers.add(this)
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ class User(val pubkey: ByteArray) {
|
|||||||
live.refresh()
|
live.refresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun updateFollows(newFollows: List<User>, updateAt: Long) {
|
fun updateFollows(newFollows: Set<User>, updateAt: Long) {
|
||||||
val toBeAdded = synchronized(follows) {
|
val toBeAdded = synchronized(follows) {
|
||||||
newFollows - follows
|
newFollows - follows
|
||||||
}
|
}
|
||||||
@ -86,7 +86,7 @@ class User(val pubkey: ByteArray) {
|
|||||||
follows - newFollows
|
follows - newFollows
|
||||||
}
|
}
|
||||||
toBeAdded.forEach {
|
toBeAdded.forEach {
|
||||||
follow(it)
|
follow(it, updateAt)
|
||||||
}
|
}
|
||||||
toBeRemoved.forEach {
|
toBeRemoved.forEach {
|
||||||
unfollow(it)
|
unfollow(it)
|
||||||
|
Reference in New Issue
Block a user