upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/sub_commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/sub_commands')
-rw-r--r--src/sub_commands/send.rs21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/sub_commands/send.rs b/src/sub_commands/send.rs
index a289def..d093cb6 100644
--- a/src/sub_commands/send.rs
+++ b/src/sub_commands/send.rs
@@ -5,7 +5,11 @@ use console::Style;
5use futures::future::join_all; 5use futures::future::join_all;
6use indicatif::{MultiProgress, ProgressBar, ProgressStyle}; 6use indicatif::{MultiProgress, ProgressBar, ProgressStyle};
7use nostr::{ 7use nostr::{
8 nips::{nip01::Coordinate, nip10::Marker, nip19::Nip19}, 8 nips::{
9 nip01::Coordinate,
10 nip10::Marker,
11 nip19::{Nip19, Nip19Event},
12 },
9 EventBuilder, FromBech32, Tag, TagKind, ToBech32, UncheckedUrl, 13 EventBuilder, FromBech32, Tag, TagKind, ToBech32, UncheckedUrl,
10}; 14};
11use nostr_sdk::{hashes::sha1::Hash as Sha1Hash, NostrSigner, TagStandard}; 15use nostr_sdk::{hashes::sha1::Hash as Sha1Hash, NostrSigner, TagStandard};
@@ -242,23 +246,24 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> {
242 246
243 if root_proposal_id.is_none() { 247 if root_proposal_id.is_none() {
244 if let Some(event) = events.first() { 248 if let Some(event) = events.first() {
245 // TODO: add gitworkshop.dev to njump and remove direct gitworkshop link 249 let event_bech32 = if let Some(relay) = repo_ref.relays.first() {
250 Nip19Event::new(event.id(), vec![relay]).to_bech32()?
251 } else {
252 event.id().to_bech32()?
253 };
246 println!( 254 println!(
247 "{}", 255 "{}",
248 dim.apply_to(format!( 256 dim.apply_to(format!(
249 "view in gitworkshop.dev: https://gitworkshop.dev/repo/{}/proposal/{}", 257 "view in gitworkshop.dev: https://gitworkshop.dev/repo/{}/proposal/{}",
250 repo_ref.identifier, 258 repo_ref.coordinate_with_hint().to_bech32()?,
251 event.id(), 259 &event_bech32,
252 )) 260 ))
253 ); 261 );
254 println!( 262 println!(
255 "{}", 263 "{}",
256 dim.apply_to(format!( 264 dim.apply_to(format!(
257 "view in another client: https://njump.me/{}", 265 "view in another client: https://njump.me/{}",
258 event 266 &event_bech32,
259 .id()
260 .to_bech32()
261 .context("cannot produce nevent from event id")?
262 )) 267 ))
263 ); 268 );
264 } 269 }