diff --git a/damus/Nostr/NostrEvent.swift b/damus/Nostr/NostrEvent.swift index b3f0f319..59880948 100644 --- a/damus/Nostr/NostrEvent.swift +++ b/damus/Nostr/NostrEvent.swift @@ -194,6 +194,7 @@ func decode_data(_ data: Data) -> T? { func event_commitment(ev: NostrEvent, tags: String) -> String { let encoder = JSONEncoder() + encoder.outputFormatting = .withoutEscapingSlashes let str_data = try! encoder.encode(ev.content) let content = String(decoding: str_data, as: UTF8.self) let commit = "[0,\"\(ev.pubkey)\",\(ev.created_at),\(ev.kind),\(tags),\(content)]" diff --git a/damus/Nostr/RelayConnection.swift b/damus/Nostr/RelayConnection.swift index 372e769c..bbd30945 100644 --- a/damus/Nostr/RelayConnection.swift +++ b/damus/Nostr/RelayConnection.swift @@ -118,6 +118,7 @@ func make_nostr_req(_ req: NostrRequest) -> String? { func make_nostr_push_event(ev: NostrEvent) -> String? { let encoder = JSONEncoder() + encoder.outputFormatting = .withoutEscapingSlashes let event_data = try! encoder.encode(ev) let event = String(decoding: event_data, as: UTF8.self) let encoded = "[\"EVENT\",\(event)]"