Unknown event fetching

Damus will now try really hard to find unknown events. It will use the
event relay hints to connect to new relays and fetch any id that is
missing.
This commit is contained in:
William Casarin 2022-11-20 12:43:32 -08:00
parent 994305ccff
commit 45b36a9945
2 changed files with 222 additions and 74 deletions

View file

@ -233,6 +233,7 @@ Relay.prototype.close = function relayClose() {
}
Relay.prototype.subscribe = function relay_subscribe(sub_id, filters) {
//console.debug("[%s] %s %s", this.url, sub_id, filters)
if (Array.isArray(filters))
this.send(["REQ", sub_id, ...filters])
else
@ -240,6 +241,7 @@ Relay.prototype.subscribe = function relay_subscribe(sub_id, filters) {
}
Relay.prototype.unsubscribe = function relay_unsubscribe(sub_id) {
//console.debug("[%s] CLOSE %s", this.url, sub_id)
this.send(["CLOSE", sub_id])
}