diff options
Diffstat (limited to 'src/login.rs')
| -rw-r--r-- | src/login.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/login.rs b/src/login.rs index aac0141..b746202 100644 --- a/src/login.rs +++ b/src/login.rs | |||
| @@ -6,7 +6,7 @@ use nostr::{ | |||
| 6 | PublicKey, | 6 | PublicKey, |
| 7 | }; | 7 | }; |
| 8 | use nostr_sdk::{ | 8 | use nostr_sdk::{ |
| 9 | Alphabet, FromBech32, JsonUtil, Keys, Kind, NostrSigner, SingleLetterTag, ToBech32, | 9 | Alphabet, FromBech32, JsonUtil, Keys, Kind, NostrSigner, SingleLetterTag, Timestamp, ToBech32, |
| 10 | }; | 10 | }; |
| 11 | use nostr_signer::Nip46Signer; | 11 | use nostr_signer::Nip46Signer; |
| 12 | 12 | ||
| @@ -104,11 +104,11 @@ pub async fn launch( | |||
| 104 | } | 104 | } |
| 105 | 105 | ||
| 106 | fn print_logged_in_as(user_ref: &UserRef, offline_mode: bool) -> Result<()> { | 106 | fn print_logged_in_as(user_ref: &UserRef, offline_mode: bool) -> Result<()> { |
| 107 | if !offline_mode && user_ref.metadata.created_at.eq(&0) { | 107 | if !offline_mode && user_ref.metadata.created_at.eq(&Timestamp::from(0)) { |
| 108 | println!("cannot find profile..."); | 108 | println!("cannot find profile..."); |
| 109 | } else if !offline_mode && user_ref.metadata.name.eq(&user_ref.public_key.to_bech32()?) { | 109 | } else if !offline_mode && user_ref.metadata.name.eq(&user_ref.public_key.to_bech32()?) { |
| 110 | println!("cannot extract account name from account metadata..."); | 110 | println!("cannot extract account name from account metadata..."); |
| 111 | } else if !offline_mode && user_ref.relays.created_at.eq(&0) { | 111 | } else if !offline_mode && user_ref.relays.created_at.eq(&Timestamp::from(0)) { |
| 112 | println!( | 112 | println!( |
| 113 | "cannot find your relay list. consider using another nostr client to create one to enhance your nostr experience." | 113 | "cannot find your relay list. consider using another nostr client to create one to enhance your nostr experience." |
| 114 | ); | 114 | ); |
| @@ -566,9 +566,9 @@ fn extract_user_metadata( | |||
| 566 | public_key.to_bech32()? | 566 | public_key.to_bech32()? |
| 567 | }, | 567 | }, |
| 568 | created_at: if let Some(event) = event { | 568 | created_at: if let Some(event) = event { |
| 569 | event.created_at.as_u64() | 569 | event.created_at |
| 570 | } else { | 570 | } else { |
| 571 | 0 | 571 | Timestamp::from(0) |
| 572 | }, | 572 | }, |
| 573 | }) | 573 | }) |
| 574 | } | 574 | } |
| @@ -600,9 +600,9 @@ fn extract_user_relays(public_key: &nostr::PublicKey, events: &[nostr::Event]) - | |||
| 600 | vec![] | 600 | vec![] |
| 601 | }, | 601 | }, |
| 602 | created_at: if let Some(event) = event { | 602 | created_at: if let Some(event) = event { |
| 603 | event.created_at.as_u64() | 603 | event.created_at |
| 604 | } else { | 604 | } else { |
| 605 | 0 | 605 | Timestamp::from(0) |
| 606 | }, | 606 | }, |
| 607 | } | 607 | } |
| 608 | } | 608 | } |