refid: add .t helper

This is used for quickly creating hashtag refs
This commit is contained in:
William Casarin
2023-07-13 09:04:01 -07:00
parent 7fc270725f
commit b7d139ffb3

View File

@@ -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 {