diff options
Diffstat (limited to 'src/lib/login/mod.rs')
| -rw-r--r-- | src/lib/login/mod.rs | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/lib/login/mod.rs b/src/lib/login/mod.rs index b484fea..47847c3 100644 --- a/src/lib/login/mod.rs +++ b/src/lib/login/mod.rs | |||
| @@ -9,7 +9,10 @@ use nostr_sdk::{NostrSigner, Timestamp, ToBech32}; | |||
| 9 | use crate::client::Client; | 9 | use crate::client::Client; |
| 10 | #[cfg(test)] | 10 | #[cfg(test)] |
| 11 | use crate::client::MockConnect; | 11 | use crate::client::MockConnect; |
| 12 | use crate::git::{Repo, RepoActions}; | 12 | use crate::{ |
| 13 | client::is_verbose, | ||
| 14 | git::{Repo, RepoActions}, | ||
| 15 | }; | ||
| 13 | 16 | ||
| 14 | pub mod existing; | 17 | pub mod existing; |
| 15 | mod key_encryption; | 18 | mod key_encryption; |
| @@ -70,14 +73,16 @@ fn print_logged_in_as( | |||
| 70 | offline_mode: bool, | 73 | offline_mode: bool, |
| 71 | source: &SignerInfoSource, | 74 | source: &SignerInfoSource, |
| 72 | ) -> Result<()> { | 75 | ) -> Result<()> { |
| 73 | if !offline_mode && user_ref.metadata.created_at.eq(&Timestamp::from(0)) { | 76 | if is_verbose() { |
| 74 | eprintln!("failed to find profile..."); | 77 | if !offline_mode && user_ref.metadata.created_at.eq(&Timestamp::from(0)) { |
| 75 | } else if !offline_mode && user_ref.metadata.name.eq(&user_ref.public_key.to_bech32()?) { | 78 | eprintln!("failed to find profile..."); |
| 76 | eprintln!("failed to extract account name from account metadata..."); | 79 | } else if !offline_mode && user_ref.metadata.name.eq(&user_ref.public_key.to_bech32()?) { |
| 77 | } else if !offline_mode && user_ref.relays.created_at.eq(&Timestamp::from(0)) { | 80 | eprintln!("failed to extract account name from account metadata..."); |
| 78 | eprintln!( | 81 | } else if !offline_mode && user_ref.relays.created_at.eq(&Timestamp::from(0)) { |
| 79 | "failed to find your relay list. consider using another nostr client to create one to enhance your nostr experience." | 82 | eprintln!( |
| 80 | ); | 83 | "failed to find your relay list. consider using another nostr client to create one to enhance your nostr experience." |
| 84 | ); | ||
| 85 | } | ||
| 81 | } | 86 | } |
| 82 | eprintln!( | 87 | eprintln!( |
| 83 | "logged in as {}{}", | 88 | "logged in as {}{}", |