Private Zaps

This adds private zaps, which have messages and authors encrypted to
the target. Keys are deterministically generated so that both the
receiver and sender can decrypt.

Changelog-Added: Private Zaps
This commit is contained in:
William Casarin
2023-03-01 07:43:44 -08:00
parent c72c0079cc
commit 77f5268336
18 changed files with 359 additions and 92 deletions

View File

@@ -7,12 +7,22 @@
import SwiftUI
struct EventViewOptions: OptionSet {
let rawValue: UInt8
static let no_action_bar = EventViewOptions(rawValue: 1 << 0)
static let no_replying_to = EventViewOptions(rawValue: 1 << 1)
static let no_images = EventViewOptions(rawValue: 1 << 2)
}
struct TextEvent: View {
let damus: DamusState
let event: NostrEvent
let pubkey: String
let has_action_bar: Bool
let booster_pubkey: String?
let options: EventViewOptions
var has_action_bar: Bool {
!options.contains(.no_action_bar)
}
var body: some View {
HStack(alignment: .top) {
@@ -62,7 +72,7 @@ struct TextEvent: View {
struct TextEvent_Previews: PreviewProvider {
static var previews: some View {
TextEvent(damus: test_damus_state(), event: test_event, pubkey: "pk", has_action_bar: true, booster_pubkey: nil)
TextEvent(damus: test_damus_state(), event: test_event, pubkey: "pk", options: [])
}
}