Replace npub with nprofile in 'Copy web link'

This commit is contained in:
Daniele Tonon 2023-09-22 16:47:13 +02:00
parent a1b59d6d6d
commit f431cd7235

View File

@ -44,7 +44,7 @@ use egui::{
#[cfg(feature = "video-ffmpeg")]
use egui_video::{AudioDevice, Player};
use egui_winit::egui::Response;
use nostr_types::{Id, IdHex, Metadata, MilliSatoshi, PublicKey, UncheckedUrl, Url};
use nostr_types::{Id, IdHex, Metadata, MilliSatoshi, Profile, PublicKey, UncheckedUrl, Url};
use std::collections::{HashMap, HashSet};
#[cfg(feature = "video-ffmpeg")]
use std::rc::Rc;
@ -1119,9 +1119,18 @@ impl GossipUi {
if ui.button("Copy web link").clicked() {
ui.output_mut(|o| {
let mut profile = Profile {
pubkey: person.pubkey,
relays: Vec::new(),
};
let relays = GLOBALS.people.get_active_person_write_relays();
for (relay_url, _) in relays.iter() {
profile.relays.push(UncheckedUrl(format!("{}", relay_url)));
}
o.copied_text = format!(
"https://njump.me/{}",
person.pubkey.as_bech32_string()
profile.as_bech32_string()
)
});
}