Adds SeenOn relays when successfully broadcasting a note.

This commit is contained in:
Vitor Pamplona
2023-09-07 12:51:55 -04:00
parent 1465ce112c
commit 3085353729

View File

@@ -69,6 +69,9 @@ abstract class NostrDataSource(val debugName: String) {
}
override fun onSendResponse(eventId: String, success: Boolean, message: String, relay: Relay) {
if (success) {
markAsSeenOnRelay(eventId, relay)
}
}
override fun onAuth(relay: Relay, challenge: String) {
@@ -182,6 +185,10 @@ abstract class NostrDataSource(val debugName: String) {
LocalCache.verifyAndConsume(event, relay)
}
open fun markAsSeenOnRelay(eventId: String, relay: Relay) {
LocalCache.getNoteIfExists(eventId)?.addRelay(relay)
}
abstract fun updateChannelFilters()
open fun auth(relay: Relay, challenge: String) = Unit
}