damus

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

commit 1bf171a09e17530d57b3ba973d68b279f1daefaf
parent c5f3a8e5090504b68276b024baf567e45facbceb
Author: William Casarin <jb55@jb55.com>
Date:   Mon,  3 Apr 2023 14:57:20 -0700

Show referenced notes in DMs

Changelog-Added: Show referenced notes in DMs

Diffstat:
Mdamus/Views/DMView.swift | 23+++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/damus/Views/DMView.swift b/damus/Views/DMView.swift @@ -14,8 +14,18 @@ struct DMView: View { var is_ours: Bool { event.pubkey == damus_state.pubkey } - - var body: some View { + + var Mention: some View { + Group { + if let mention = first_eref_mention(ev: event, privkey: damus_state.keypair.privkey) { + BuilderEventView(damus: damus_state, event_id: mention.ref.id) + } else { + EmptyView() + } + } + } + + var DM: some View { HStack { if is_ours { Spacer(minLength: UIScreen.main.bounds.width * 0.2) @@ -36,11 +46,20 @@ struct DMView: View { .foregroundColor(.gray) .opacity(0.8) .offset(x: -10, y: -5), alignment: .bottomTrailing) + if !is_ours { Spacer(minLength: UIScreen.main.bounds.width * 0.2) } } } + + var body: some View { + VStack { + Mention + DM + } + + } } struct DMView_Previews: PreviewProvider {