Add undo to channel messages

This commit is contained in:
Jon Staab
2024-10-16 15:57:18 -07:00
parent 13628aeb71
commit 86622b7ce5
7 changed files with 69 additions and 65 deletions
+6 -2
View File
@@ -196,11 +196,13 @@ export const checkRelayAccess = async (url: string, claim = "") => {
await connection.auth.attemptIfRequested()
await connection.auth.waitIfPending()
const result = await publishThunk({
const thunk = publishThunk({
event: createEvent(AUTH_JOIN, {tags: [["claim", claim]]}),
relays: [url],
})
const result = await thunk.result
if (result[url].status !== PublishStatus.Success) {
const message = result[url].message?.replace(/^.*: /, "") || "join request rejected"
@@ -259,10 +261,12 @@ export const sendWrapped = async ({
await Promise.all(
uniq(pubkeys).map(async recipient => {
return publishThunk({
const thunk = publishThunk({
event: await nip59.wrap(recipient, stamp(template)),
relays: ctx.app.router.PublishMessage(recipient).getUrls(),
})
await thunk.result
}),
)
}