1
0
mirror of git://jb55.com/damus synced 2024-09-29 16:30:44 +00:00

note: add is_quote_repost helper

This will be used for excluding quote repost notes from threads

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin 2024-03-16 12:15:48 +00:00
parent 770a845b36
commit 1339ec3ded

View File

@ -280,6 +280,13 @@ extension NdbNote {
return kind == 1 || kind == 42 || kind == 30023
}
var is_quote_repost: NoteId? {
guard kind == 1, let quoted_note_id = referenced_quote_ids.first else {
return nil
}
return quoted_note_id.note_id
}
var known_kind: NostrKind? {
return NostrKind.init(rawValue: kind)
}