commit b7d139ffb3d6b2dd0ebe262b20e7a44a0c5d8d23
parent 7fc270725f3b68dc10b0bff57e15a7e95706c4b7
Author: William Casarin <jb55@jb55.com>
Date: Thu, 13 Jul 2023 09:04:01 -0700
refid: add .t helper
This is used for quickly creating hashtag refs
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git 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 {