From b7d139ffb3d6b2dd0ebe262b20e7a44a0c5d8d23 Mon Sep 17 00:00:00 2001 From: William Casarin Date: Thu, 13 Jul 2023 09:04:01 -0700 Subject: [PATCH] refid: add .t helper This is used for quickly creating hashtag refs --- damus/Nostr/NostrEvent.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/damus/Nostr/NostrEvent.swift b/damus/Nostr/NostrEvent.swift index 9babb617..8e503751 100644 --- a/damus/Nostr/NostrEvent.swift +++ b/damus/Nostr/NostrEvent.swift @@ -40,6 +40,10 @@ struct ReferencedId: Identifiable, Hashable, Equatable { static func p(_ pk: String, relay_id: String? = nil) -> ReferencedId { return ReferencedId(ref_id: pk, relay_id: relay_id, key: "p") } + + static func t(_ hashtag: String, relay_id: String? = nil) -> ReferencedId { + return ReferencedId(ref_id: hashtag, relay_id: relay_id, key: "t") + } } class NostrEvent: Codable, Identifiable, CustomStringConvertible, Equatable, Hashable, Comparable {