show who we're replying to
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -7,12 +7,33 @@
|
|||||||
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
|
func all_referenced_pubkeys(_ ev: NostrEvent) -> [ReferencedId] {
|
||||||
|
var keys = ev.referenced_pubkeys
|
||||||
|
let ref = ReferencedId(ref_id: ev.pubkey, relay_id: nil, key: "p")
|
||||||
|
keys.insert(ref, at: 0)
|
||||||
|
return keys
|
||||||
|
}
|
||||||
|
|
||||||
struct ReplyView: View {
|
struct ReplyView: View {
|
||||||
let replying_to: NostrEvent
|
let replying_to: NostrEvent
|
||||||
|
|
||||||
|
@EnvironmentObject var profiles: Profiles
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack {
|
VStack {
|
||||||
Text("Replying to:")
|
Text("Replying to:")
|
||||||
|
HStack {
|
||||||
|
let names = all_referenced_pubkeys(replying_to)
|
||||||
|
.map { pubkey in
|
||||||
|
let pk = pubkey.ref_id
|
||||||
|
let prof = profiles.lookup(id: pk)
|
||||||
|
return Profile.displayName(profile: prof, pubkey: pk)
|
||||||
|
}
|
||||||
|
.joined(separator: ", ")
|
||||||
|
Text(names)
|
||||||
|
.foregroundColor(.gray)
|
||||||
|
.font(.footnote)
|
||||||
|
}
|
||||||
EventView(event: replying_to, highlight: .none, has_action_bar: false)
|
EventView(event: replying_to, highlight: .none, has_action_bar: false)
|
||||||
PostView(references: replying_to.reply_ids(pubkey: replying_to.pubkey))
|
PostView(references: replying_to.reply_ids(pubkey: replying_to.pubkey))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user