damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit 1854e104861dcb10b241614913b6ea5e8d09d2e4
parent 58e2fb40ef651e32ed659f421e44e1fb19be8fe9
Author: William Casarin <jb55@jb55.com>
Date:   Sat, 22 Jul 2023 16:57:33 -0700

mentions: add ndb mention parser

Diffstat:
Mdamus/Models/Mentions.swift | 9+++++++++
1 file changed, 9 insertions(+), 0 deletions(-)

diff --git a/damus/Models/Mentions.swift b/damus/Models/Mentions.swift @@ -427,6 +427,15 @@ struct PostTags { let tags: [[String]] } +func parse_mention_type_ndb(_ tag: NdbTagElem) -> MentionType? { + if tag.matches_char("e") { + return .event + } else if tag.matches_char("p") { + return .pubkey + } + return nil +} + func parse_mention_type(_ c: String) -> MentionType? { if c == "e" { return .event