commit 453d57405b510adf72a317b5d12d176083487cd8
parent 0ac321895201de18744db0354787f572d21e29e1
Author: William Casarin <jb55@jb55.com>
Date: Sun, 17 Apr 2022 14:24:05 -0700
replies: only reference root and immediate reply event
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/damus/Nostr/NostrEvent.swift b/damus/Nostr/NostrEvent.swift
@@ -88,9 +88,9 @@ class NostrEvent: Codable, Identifiable {
}
public func reply_ids(pubkey: String) -> [ReferencedId] {
- var ids = self.referenced_ids
- ids.append(contentsOf: self.referenced_pubkeys)
+ var ids = self.referenced_ids.first.map { [$0] } ?? []
ids.append(ReferencedId(ref_id: self.id, relay_id: nil, key: "e"))
+ ids.append(contentsOf: self.referenced_pubkeys)
ids.append(ReferencedId(ref_id: pubkey, relay_id: nil, key: "p"))
return ids
}