edit relays

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2022-06-09 13:47:25 -07:00
parent e104de6431
commit 6de7d7ae58
7 changed files with 329 additions and 36 deletions

View File

@@ -165,7 +165,7 @@ class NostrEvent: Codable, Identifiable, CustomStringConvertible {
public var is_local: Bool {
return (self.flags & 1) != 0
}
init(content: String, pubkey: String, kind: Int = 1, tags: [[String]] = []) {
self.id = ""
self.sig = ""
@@ -176,6 +176,17 @@ class NostrEvent: Codable, Identifiable, CustomStringConvertible {
self.tags = tags
self.created_at = Int64(Date().timeIntervalSince1970)
}
init(from: NostrEvent) {
self.id = from.id
self.sig = from.sig
self.content = from.content
self.pubkey = from.pubkey
self.kind = from.kind
self.tags = from.tags
self.created_at = from.created_at
}
func calculate_id() {
self.id = calculate_event_id(ev: self)