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:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-04-22 09:29:18 +0100
committerDanConwayDev <DanConwayDev@protonmail.com>2024-04-22 09:29:18 +0100
commit6bfd8b0ddec7f8f4c24a97d357de9acd615b0b17 (patch)
tree5ae22330839b999f9d6e69faf11ad5ac91782448 /src/sub_commands
parent4b49ab05e3b8fa3146d7dfd0c8e5250c14df46ae (diff)
feat(send): print link to proposal root
after a new root proposal has been sent link directly to gitworkshop.dev as well as njump.me until gitworkshop is added to njump
Diffstat (limited to 'src/sub_commands')
-rw-r--r--src/sub_commands/send.rs28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/sub_commands/send.rs b/src/sub_commands/send.rs
index d9caf9b..78d00b2 100644
--- a/src/sub_commands/send.rs
+++ b/src/sub_commands/send.rs
@@ -6,7 +6,7 @@ use futures::future::join_all;
6use indicatif::{MultiProgress, ProgressBar, ProgressStyle}; 6use indicatif::{MultiProgress, ProgressBar, ProgressStyle};
7use nostr::{ 7use nostr::{
8 nips::{nip01::Coordinate, nip19::Nip19}, 8 nips::{nip01::Coordinate, nip19::Nip19},
9 EventBuilder, FromBech32, Marker, Tag, TagKind, UncheckedUrl, 9 EventBuilder, FromBech32, Marker, Tag, TagKind, ToBech32, UncheckedUrl,
10}; 10};
11use nostr_sdk::hashes::sha1::Hash as Sha1Hash; 11use nostr_sdk::hashes::sha1::Hash as Sha1Hash;
12 12
@@ -220,12 +220,36 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> {
220 220
221 send_events( 221 send_events(
222 &client, 222 &client,
223 events, 223 events.clone(),
224 user_ref.relays.write(), 224 user_ref.relays.write(),
225 repo_ref.relays.clone(), 225 repo_ref.relays.clone(),
226 !cli_args.disable_cli_spinners, 226 !cli_args.disable_cli_spinners,
227 ) 227 )
228 .await?; 228 .await?;
229
230 if args.in_reply_to.is_none() {
231 if let Some(event) = events.first() {
232 // TODO: add gitworkshop.dev to njump and remove direct gitworkshop link
233 println!(
234 "{}",
235 dim.apply_to(format!(
236 "view in gitworkshop.dev: https://gitworkshop.dev/repo/{}/proposal/{}",
237 repo_ref.identifier,
238 event.id(),
239 ))
240 );
241 println!(
242 "{}",
243 dim.apply_to(format!(
244 "view in another client: https://njump.me/{}",
245 event
246 .id()
247 .to_bech32()
248 .context("cannot produce nevent from event id")?
249 ))
250 );
251 }
252 }
229 // TODO check if there is already a similarly named 253 // TODO check if there is already a similarly named
230 Ok(()) 254 Ok(())
231} 255}