Update NIP90ContentDiscoveryFilter.kt
This commit is contained in:
@@ -56,6 +56,7 @@ open class NIP90ContentDiscoveryFilter(
|
|||||||
noteEvent is NIP90ContentDiscoveryResponseEvent && it.event?.pubKey() == dvmkey && it.event?.isTaggedUser(account.keyPair.pubKey.toHexKey()) == true // && params.match(noteEvent)
|
noteEvent is NIP90ContentDiscoveryResponseEvent && it.event?.pubKey() == dvmkey && it.event?.isTaggedUser(account.keyPair.pubKey.toHexKey()) == true // && params.match(noteEvent)
|
||||||
}
|
}
|
||||||
var sorted = sort(notes)
|
var sorted = sort(notes)
|
||||||
|
if (sorted.isNotEmpty()) {
|
||||||
var note = sorted.first()
|
var note = sorted.first()
|
||||||
|
|
||||||
var eventContent = note.event?.content()
|
var eventContent = note.event?.content()
|
||||||
@@ -71,6 +72,9 @@ open class NIP90ContentDiscoveryFilter(
|
|||||||
}
|
}
|
||||||
|
|
||||||
return sort(collection)
|
return sort(collection)
|
||||||
|
} else {
|
||||||
|
return sort(notes)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun applyFilter(collection: Set<Note>): Set<Note> {
|
override fun applyFilter(collection: Set<Note>): Set<Note> {
|
||||||
@@ -98,6 +102,7 @@ open class NIP90ContentDiscoveryFilter(
|
|||||||
// TODO. We want to parse the content of the latest event to ids and get the nodes from these ids
|
// TODO. We want to parse the content of the latest event to ids and get the nodes from these ids
|
||||||
|
|
||||||
/* var sorted = sort(notes)
|
/* var sorted = sort(notes)
|
||||||
|
if (sorted.isNotEmpty()) {
|
||||||
var note = sorted.first()
|
var note = sorted.first()
|
||||||
|
|
||||||
var eventContent = note.event?.content()
|
var eventContent = note.event?.content()
|
||||||
@@ -115,8 +120,11 @@ open class NIP90ContentDiscoveryFilter(
|
|||||||
collection + note
|
collection + note
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return collection
|
return collection
|
||||||
|
} else {
|
||||||
|
return notes
|
||||||
|
}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
return notes
|
return notes
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user