From 7eba921bf863649dcb408349f25bdaf4c92ddc5f Mon Sep 17 00:00:00 2001 From: William Casarin Date: Sun, 7 Aug 2022 18:56:43 -0700 Subject: [PATCH] dms: create parse and create links in DMs Changelog-Fixed: You can now reference users, notes hashtags in DMs Signed-off-by: William Casarin --- damus/Views/DMChatView.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/damus/Views/DMChatView.swift b/damus/Views/DMChatView.swift index 0e0d97c..ebcdd41 100644 --- a/damus/Views/DMChatView.swift +++ b/damus/Views/DMChatView.swift @@ -108,7 +108,11 @@ struct DMChatView: View { } func send_message() { - guard let dm = create_dm(message, to_pk: pubkey, keypair: damus_state.keypair) else { + let post_blocks = parse_post_blocks(content: message) + let post_tags = make_post_tags(post_blocks: post_blocks, tags: []) + let content = render_blocks(blocks: post_tags.blocks) + + guard let dm = create_dm(content, to_pk: pubkey, keypair: damus_state.keypair) else { print("error creating dm") return }