damus

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

commit 3511b1ee9104d60c9efa07a82682aab498c2f5de
parent 78a62c8ef0b94f228f1f3838be1cbc36f8631348
Author: Terry Yiu <git@tyiu.xyz>
Date:   Mon, 14 Apr 2025 12:38:29 -0400

Fix quote notes to include missing q tag

Changelog-Fixed: Fix quote notes to include missing q tag

Closes: https://github.com/damus-io/damus/issues/2615
Signed-off-by: Terry Yiu <git@tyiu.xyz>

Diffstat:
Mdamus/Views/PostView.swift | 2++
MdamusTests/PostViewTests.swift | 6++++++
2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/damus/Views/PostView.swift b/damus/Views/PostView.swift @@ -883,6 +883,8 @@ func build_post(state: DamusState, post: NSAttributedString, action: PostAction, case .quoting(let ev): content.append("\n\nnostr:" + bech32_note_id(ev.id)) + tags.append(["q", ev.id.hex()]); + if let quoted_ev = state.events.lookup(ev.id) { tags.append(["p", quoted_ev.pubkey.hex()]) } diff --git a/damusTests/PostViewTests.swift b/damusTests/PostViewTests.swift @@ -170,6 +170,12 @@ final class PostViewTests: XCTestCase { nonAlphaNumerics.forEach { testAddingStringAfterLink(str: $0)} } + + func testQuoteRepost() { + let post = build_post(state: test_damus_state, post: .init(), action: .quoting(test_note), uploadedMedias: [], pubkeys: []) + + XCTAssertEqual(post.tags, [["q", test_note.id.hex()]]) + } } func checkMentionLinkEditorHandling(