Remove client tag when requesting zap

This commit is contained in:
Jonathan Staab 2023-04-06 16:36:49 -05:00
parent 2c8b6608ea
commit 35862fdd48
2 changed files with 15 additions and 4 deletions

View File

@ -94,7 +94,7 @@ const requestZap = (relays, content, pubkey, eventId, amount, lnurl) => {
tags.push(["e", eventId])
}
return new PublishableEvent(9734, {content, tags})
return new PublishableEvent(9734, {content, tags, tagClient: false})
}
const deleteEvent = ids => new PublishableEvent(5, {tags: ids.map(id => ["e", id])})
@ -165,11 +165,13 @@ const uniqTags = uniqBy(t => t.slice(0, 2).join(":"))
class PublishableEvent {
event: Record<string, any>
constructor(kind, {content = "", tags = []}) {
constructor(kind, {content = "", tags = [], tagClient = true}) {
const pubkey = get(keys.pubkey)
const createdAt = Math.round(new Date().valueOf() / 1000)
tags.push(["client", "coracle"])
if (tagClient) {
tags.push(["client", "coracle"])
}
this.event = {kind, content, tags, pubkey, created_at: createdAt}
}

View File

@ -6,6 +6,7 @@
import {tweened} from "svelte/motion"
import {slide} from "svelte/transition"
import {quantify} from "hurdak/lib/hurdak"
import {warn} from "src/util/logger"
import {Tags, displayRelay, findRootId, findReplyId, displayPerson, isLike} from "src/util/nostr"
import {
stringToHue,
@ -273,6 +274,10 @@
return
}
if (!res.pr) {
throw new Error(JSON.stringify(res))
}
zap.invoice = res.pr
zap.loading = false
@ -281,7 +286,11 @@
if (webln) {
await webln.enable()
webln.sendPayment(zap.invoice)
try {
webln.sendPayment(zap.invoice)
} catch (e) {
warn(e)
}
}
// Listen for the zap confirmation