diff options
Diffstat (limited to 'src/sub_commands/send.rs')
| -rw-r--r-- | src/sub_commands/send.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/sub_commands/send.rs b/src/sub_commands/send.rs index 1d20e90..7c8f2ee 100644 --- a/src/sub_commands/send.rs +++ b/src/sub_commands/send.rs | |||
| @@ -19,7 +19,7 @@ use crate::{ | |||
| 19 | cli_interactor::{ | 19 | cli_interactor::{ |
| 20 | Interactor, InteractorPrompt, PromptConfirmParms, PromptInputParms, PromptMultiChoiceParms, | 20 | Interactor, InteractorPrompt, PromptConfirmParms, PromptInputParms, PromptMultiChoiceParms, |
| 21 | }, | 21 | }, |
| 22 | client::Connect, | 22 | client::{sign_event, Connect}, |
| 23 | git::{Repo, RepoActions}, | 23 | git::{Repo, RepoActions}, |
| 24 | login, | 24 | login, |
| 25 | repo_ref::{self, RepoRef, REPO_REF_KIND}, | 25 | repo_ref::{self, RepoRef, REPO_REF_KIND}, |
| @@ -180,6 +180,8 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { | |||
| 180 | }; | 180 | }; |
| 181 | let (signer, user_ref) = login::launch( | 181 | let (signer, user_ref) = login::launch( |
| 182 | &git_repo, | 182 | &git_repo, |
| 183 | &cli_args.bunker_uri, | ||
| 184 | &cli_args.bunker_app_key, | ||
| 183 | &cli_args.nsec, | 185 | &cli_args.nsec, |
| 184 | &cli_args.password, | 186 | &cli_args.password, |
| 185 | Some(&client), | 187 | Some(&client), |
| @@ -593,7 +595,7 @@ pub async fn generate_cover_letter_and_patch_events( | |||
| 593 | let mut events = vec![]; | 595 | let mut events = vec![]; |
| 594 | 596 | ||
| 595 | if let Some((title, description)) = cover_letter_title_description { | 597 | if let Some((title, description)) = cover_letter_title_description { |
| 596 | events.push(signer.sign_event_builder(EventBuilder::new( | 598 | events.push(sign_event(EventBuilder::new( |
| 597 | nostr::event::Kind::Custom(PATCH_KIND), | 599 | nostr::event::Kind::Custom(PATCH_KIND), |
| 598 | format!( | 600 | format!( |
| 599 | "From {} Mon Sep 17 00:00:00 2001\nSubject: [PATCH 0/{}] {title}\n\n{description}", | 601 | "From {} Mon Sep 17 00:00:00 2001\nSubject: [PATCH 0/{}] {title}\n\n{description}", |
| @@ -656,7 +658,7 @@ pub async fn generate_cover_letter_and_patch_events( | |||
| 656 | .map(|pk| Tag::public_key(*pk)) | 658 | .map(|pk| Tag::public_key(*pk)) |
| 657 | .collect(), | 659 | .collect(), |
| 658 | ].concat(), | 660 | ].concat(), |
| 659 | )).await | 661 | ), signer).await |
| 660 | .context("failed to create cover-letter event")?); | 662 | .context("failed to create cover-letter event")?); |
| 661 | } | 663 | } |
| 662 | 664 | ||
| @@ -883,7 +885,7 @@ pub async fn generate_patch_event( | |||
| 883 | .context("failed to get parent commit")?; | 885 | .context("failed to get parent commit")?; |
| 884 | let relay_hint = repo_ref.relays.first().map(nostr::UncheckedUrl::from); | 886 | let relay_hint = repo_ref.relays.first().map(nostr::UncheckedUrl::from); |
| 885 | 887 | ||
| 886 | signer.sign_event_builder(EventBuilder::new( | 888 | sign_event(EventBuilder::new( |
| 887 | nostr::event::Kind::Custom(PATCH_KIND), | 889 | nostr::event::Kind::Custom(PATCH_KIND), |
| 888 | git_repo | 890 | git_repo |
| 889 | .make_patch_from_commit(commit,&series_count) | 891 | .make_patch_from_commit(commit,&series_count) |
| @@ -1000,7 +1002,7 @@ pub async fn generate_patch_event( | |||
| 1000 | ], | 1002 | ], |
| 1001 | ] | 1003 | ] |
| 1002 | .concat(), | 1004 | .concat(), |
| 1003 | )).await | 1005 | ), signer).await |
| 1004 | .context("failed to sign event") | 1006 | .context("failed to sign event") |
| 1005 | } | 1007 | } |
| 1006 | // TODO | 1008 | // TODO |