replying works

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2022-04-17 08:49:02 -07:00
parent b4660bd58f
commit 700a0e2625
5 changed files with 53 additions and 3 deletions

View File

@@ -112,7 +112,7 @@ struct ContentView: View {
.sheet(item: $active_sheet) { item in
switch item {
case .post:
PostView()
PostView(references: [])
}
}
.onReceive(NotificationCenter.default.publisher(for: .post)) { obj in
@@ -120,6 +120,10 @@ struct ContentView: View {
print("post \(post.content)")
let privkey = ""
let new_ev = NostrEvent(content: post.content, pubkey: pubkey)
for id in post.references {
new_ev.tags.append(["e", id])
}
new_ev.calculate_id()
new_ev.sign(privkey: privkey)
self.pool?.send(.event(new_ev))
}