diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-10-02 11:42:36 +0100 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-10-02 11:42:36 +0100 |
| commit | e60a419510696e3fa25a35be6cba35e547b53e24 (patch) | |
| tree | f96badf697c8a14d2e269c2715ad9e94dd220e83 /src | |
| parent | c1be79dd9c69c9e406f3c067ba8ac4719b80d142 (diff) | |
chore: apply patched rust-nostr
which includes nip46 signer change so it can be initated
without completing connection.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/login/mod.rs | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/lib/login/mod.rs b/src/lib/login/mod.rs index f262bda..d774426 100644 --- a/src/lib/login/mod.rs +++ b/src/lib/login/mod.rs | |||
| @@ -290,15 +290,12 @@ async fn get_nip46_signer_from_uri_and_key(uri: &str, app_key: &str) -> Result<N | |||
| 290 | let term = console::Term::stderr(); | 290 | let term = console::Term::stderr(); |
| 291 | term.write_line("connecting to remote signer...")?; | 291 | term.write_line("connecting to remote signer...")?; |
| 292 | let uri = NostrConnectURI::parse(uri)?; | 292 | let uri = NostrConnectURI::parse(uri)?; |
| 293 | let signer = NostrSigner::nip46( | 293 | let signer = NostrSigner::nip46(Nip46Signer::new( |
| 294 | Nip46Signer::new( | 294 | uri, |
| 295 | uri, | 295 | nostr::Keys::from_str(app_key).context("invalid app key")?, |
| 296 | nostr::Keys::from_str(app_key).context("invalid app key")?, | 296 | Duration::from_secs(10 * 60), |
| 297 | Duration::from_secs(10 * 60), | 297 | None, |
| 298 | None, | 298 | )?); |
| 299 | ) | ||
| 300 | .await?, | ||
| 301 | ); | ||
| 302 | term.clear_last_lines(1)?; | 299 | term.clear_last_lines(1)?; |
| 303 | Ok(signer) | 300 | Ok(signer) |
| 304 | } | 301 | } |
| @@ -411,9 +408,7 @@ async fn fresh_login( | |||
| 411 | app_key.clone(), | 408 | app_key.clone(), |
| 412 | Duration::from_secs(10 * 60), | 409 | Duration::from_secs(10 * 60), |
| 413 | None, | 410 | None, |
| 414 | ) | 411 | ) { |
| 415 | .await | ||
| 416 | { | ||
| 417 | let signer = NostrSigner::nip46(nip46_signer); | 412 | let signer = NostrSigner::nip46(nip46_signer); |
| 418 | if let Ok(pub_key) = fetch_public_key(&signer).await { | 413 | if let Ok(pub_key) = fetch_public_key(&signer).await { |
| 419 | let mut printer_locked = printer_clone.lock().await; | 414 | let mut printer_locked = printer_clone.lock().await; |