Only send lud12 comment if its not a private zap

This commit is contained in:
William Casarin
2023-03-01 10:51:49 -08:00
parent 7f385b2e7e
commit 071a4209ea

View File

@@ -310,7 +310,7 @@ func fetch_zap_invoice(_ payreq: LNUrlPayRequest, zapreq: NostrEvent?, sats: Int
}
// add a lud12 comment as well if we have it
if let comment, let limit = payreq.commentAllowed, limit != 0 {
if zap_type != .priv, let comment, let limit = payreq.commentAllowed, limit != 0 {
let limited_comment = String(comment.prefix(limit))
query.append(URLQueryItem(name: "comment", value: limited_comment))
}
@@ -323,7 +323,15 @@ func fetch_zap_invoice(_ payreq: LNUrlPayRequest, zapreq: NostrEvent?, sats: Int
print("url \(url)")
guard let ret = try? await URLSession.shared.data(from: url) else {
var ret: (Data, URLResponse)? = nil
do {
ret = try await URLSession.shared.data(from: url)
} catch {
print(error.localizedDescription)
return nil
}
guard let ret else {
return nil
}