Update LnZapRequestEvent.kt

This commit is contained in:
Believethehype 2023-04-22 05:54:43 +02:00
parent bd64a7de63
commit 9ae13a9f97

View File

@ -88,13 +88,13 @@ class LnZapRequestEvent(
pubKey = Utils.pubkeyCreate(privkey).toHexKey() pubKey = Utils.pubkeyCreate(privkey).toHexKey()
tags = tags + listOf(listOf("anon", "")) tags = tags + listOf(listOf("anon", ""))
} else if (zapType == LnZapEvent.ZapType.PRIVATE) { } else if (zapType == LnZapEvent.ZapType.PRIVATE) {
var enc_prkey = createEncryptionPrivateKey(privateKey.toHexKey(), userHex, createdAt) var encryptionPrivateKey = createEncryptionPrivateKey(privateKey.toHexKey(), userHex, createdAt)
var noteJson = (create(privkey, 9733, listOf(tags[0], tags[1]), message)).toJson() var noteJson = (create(privkey, 9733, listOf(tags[0], tags[1]), message)).toJson()
var privreq = encryptPrivateZapMessage(noteJson, enc_prkey, userHex.toByteArray()) var encryptedContent = encryptPrivateZapMessage(noteJson, encryptionPrivateKey, userHex.toByteArray())
tags = tags + listOf(listOf("anon", privreq)) tags = tags + listOf(listOf("anon", encryptedContent))
content = "" content = ""
privkey = enc_prkey privkey = encryptionPrivateKey
pubKey = Utils.pubkeyCreate(enc_prkey).toHexKey() pubKey = Utils.pubkeyCreate(encryptionPrivateKey).toHexKey()
} }
val id = generateId(pubKey, createdAt, kind, tags, content) val id = generateId(pubKey, createdAt, kind, tags, content)
val sig = Utils.sign(id, privkey) val sig = Utils.sign(id, privkey)