From f3361e6eae020db25a84a446797241d556521a36 Mon Sep 17 00:00:00 2001 From: alltheseas Date: Mon, 2 Feb 2026 12:15:51 -0600 Subject: [PATCH] Add client tag accessor to NdbNote Add a clientTag property to NdbNote that parses and returns the client tag metadata from an event's tags, enabling display of which app published an event. Ref: https://github.com/damus-io/damus/issues/3323 Signed-off-by: alltheseas --- nostrdb/NdbNote.swift | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/nostrdb/NdbNote.swift b/nostrdb/NdbNote.swift index c9aab1f1..5a932adc 100644 --- a/nostrdb/NdbNote.swift +++ b/nostrdb/NdbNote.swift @@ -470,6 +470,19 @@ extension NdbNote { public var references: References { References(tags: self.tags) } + + /// Parses and returns the client tag metadata if present on this note. + var clientTag: ClientTagMetadata? { + for tag in tags { + guard tag.count >= 2, tag[0].matches_str("client") else { + continue + } + if let metadata = ClientTagMetadata(tagComponents: tag.strings()) { + return metadata + } + } + return nil + } func thread_reply() -> ThreadReply? { if self.known_kind != .highlight {