diff options
Diffstat (limited to 'src/sub_commands')
| -rw-r--r-- | src/sub_commands/send.rs | 28 |
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; | |||
| 6 | use indicatif::{MultiProgress, ProgressBar, ProgressStyle}; | 6 | use indicatif::{MultiProgress, ProgressBar, ProgressStyle}; |
| 7 | use nostr::{ | 7 | use 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 | }; |
| 11 | use nostr_sdk::hashes::sha1::Hash as Sha1Hash; | 11 | use 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 | } |