mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-27 20:26:33 +02:00
Moves contact list to closer to metadata in the Local Cache
This commit is contained in:
@@ -176,6 +176,16 @@ object LocalCache {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun consume(event: ContactListEvent) {
|
||||||
|
val user = getOrCreateUser(event.pubKey)
|
||||||
|
|
||||||
|
// avoids processing empty contact lists.
|
||||||
|
if (event.createdAt > (user.latestContactList?.createdAt ?: 0) && !event.tags.isEmpty()) {
|
||||||
|
user.updateContactList(event)
|
||||||
|
// Log.d("CL", "AAA ${user.toBestDisplayName()} ${follows.size}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun consume(event: BookmarkListEvent) {
|
fun consume(event: BookmarkListEvent) {
|
||||||
val user = getOrCreateUser(event.pubKey)
|
val user = getOrCreateUser(event.pubKey)
|
||||||
if (user.latestBookmarkList == null || event.createdAt > user.latestBookmarkList!!.createdAt) {
|
if (user.latestBookmarkList == null || event.createdAt > user.latestBookmarkList!!.createdAt) {
|
||||||
@@ -580,16 +590,6 @@ object LocalCache {
|
|||||||
// // Log.d("RR", event.toJson())
|
// // Log.d("RR", event.toJson())
|
||||||
}
|
}
|
||||||
|
|
||||||
fun consume(event: ContactListEvent) {
|
|
||||||
val user = getOrCreateUser(event.pubKey)
|
|
||||||
|
|
||||||
// avoids processing empty contact lists.
|
|
||||||
if (event.createdAt > (user.latestContactList?.createdAt ?: 0) && !event.tags.isEmpty()) {
|
|
||||||
user.updateContactList(event)
|
|
||||||
// Log.d("CL", "AAA ${user.toBestDisplayName()} ${follows.size}")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun consume(event: PrivateDmEvent, relay: Relay?): Note {
|
fun consume(event: PrivateDmEvent, relay: Relay?): Note {
|
||||||
val note = getOrCreateNote(event.id)
|
val note = getOrCreateNote(event.id)
|
||||||
val author = getOrCreateUser(event.pubKey)
|
val author = getOrCreateUser(event.pubKey)
|
||||||
|
Reference in New Issue
Block a user