From 6ed562ed24bf2dfa2aa17401101f9afcc56b295d Mon Sep 17 00:00:00 2001 From: Joshua Jiang Date: Sat, 15 Apr 2023 23:05:10 -0700 Subject: [PATCH] Fix shuffling when choosing users to reply to Changelog-Fixed: Fix shuffling when choosing users to reply to Co-authored-by: William Casarin Closes: #937 --- damus/Nostr/NostrEvent.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/damus/Nostr/NostrEvent.swift b/damus/Nostr/NostrEvent.swift index 3a106c06..45798274 100644 --- a/damus/Nostr/NostrEvent.swift +++ b/damus/Nostr/NostrEvent.swift @@ -724,7 +724,7 @@ func gather_reply_ids(our_pubkey: String, from: NostrEvent) -> [ReferencedId] { var ids = get_referenced_ids(tags: from.tags, key: "e").first.map { [$0] } ?? [] ids.append(ReferencedId(ref_id: from.id, relay_id: nil, key: "e")) - ids.append(contentsOf: from.referenced_pubkeys.filter { $0.ref_id != our_pubkey }) + ids.append(contentsOf: Set(from.referenced_pubkeys.filter { $0.ref_id != our_pubkey })) if from.pubkey != our_pubkey { ids.append(ReferencedId(ref_id: from.pubkey, relay_id: nil, key: "p")) }