nip10: add marker nip10 support when reading notes

We still need to add these when writing notes.

Changelog-Added: Add marker nip10 support when reading notes
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2024-04-25 14:03:34 -07:00
parent 007bcc8687
commit a721256e9b
4 changed files with 203 additions and 13 deletions

View File

@@ -13,6 +13,15 @@ enum EventRef: Equatable {
case reply(NoteRef)
case reply_to_root(NoteRef)
var note_ref: NoteRef {
switch self {
case .mention(let mnref): return mnref.ref
case .thread_id(let ref): return ref
case .reply(let ref): return ref
case .reply_to_root(let ref): return ref
}
}
var is_mention: NoteRef? {
if case .mention(let m) = self { return m.ref }
return nil