nip19: do not include tag for nevent mention
When creating an NostrEvent with an nevent1 mention, don't include the nevent mentions in the event's tags. This matches the behavior for note1 mentions. Tests for content with npub1 and note1 mentions were added to confirm tag generation behavior. Test for nevent mention tag generation was modified to be the same as note1. Closes: https://github.com/damus-io/damus/issues/1941 Lightning-address: kernelkind@getalby.com Signed-off-by: kernelkind <kernelkind@gmail.com> Reviewed-by: William Casarin <jb55@jb55.com> Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
committed by
William Casarin
parent
7cc2825d89
commit
9d91856ea3
@@ -269,8 +269,11 @@ func make_post_tags(post_blocks: [Block], tags: [[String]]) -> PostTags {
|
||||
for post_block in post_blocks {
|
||||
switch post_block {
|
||||
case .mention(let mention):
|
||||
if case .note = mention.ref {
|
||||
switch(mention.ref) {
|
||||
case .note, .nevent:
|
||||
continue
|
||||
default:
|
||||
break
|
||||
}
|
||||
|
||||
new_tags.append(mention.ref.tag)
|
||||
|
||||
Reference in New Issue
Block a user