Add message to handlers

This commit is contained in:
Jon Staab
2024-08-27 11:54:04 -07:00
parent fcbaa67ade
commit 8a8bea71be
13 changed files with 71 additions and 61 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@welshman/net",
"version": "0.0.19",
"version": "0.0.20",
"author": "hodlbod",
"license": "MIT",
"description": "Utilities for connecting with nostr relays.",
@@ -32,7 +32,7 @@
},
"dependencies": {
"@welshman/lib": "0.0.15",
"@welshman/util": "0.0.27",
"@welshman/util": "0.0.28",
"isomorphic-ws": "^5.0.0",
"ws": "^8.16.0"
}
+3 -3
View File
@@ -83,11 +83,11 @@ export const publish = (request: PublishRequest) => {
// Delegate to our executor
const executorSub = executor.publish(event, {
verb: request.verb || "EVENT",
onOk: (url: string, eventId: string, ok: boolean) => {
onOk: (url: string, eventId: string, ok: boolean, message: string) => {
if (ok) {
pub.emitter.emit(PublishStatus.Success, url)
pub.emitter.emit(PublishStatus.Success, url, message)
} else {
pub.emitter.emit(PublishStatus.Failure, url)
pub.emitter.emit(PublishStatus.Failure, url, message)
}
},
onError: (url: string) => {