feat: Implemented NIP-4e (#11)
* chore: refactor account registry * wip: nip4e * chore: rename account to device * feat: nip44 encryption with master signer * update * refactor * feat: unwrap with device keys * chore: improve handler * chore: fix rustls * chore: refactor onboarding * chore: fix compose * chore: fix send message * chore: fix forgot to request device * fix send message * chore: fix deadlock * chore: small fixes * chore: improve * fix * refactor * refactor * refactor * fix * add fetch request * save keys * fix * update * update * update
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
use global::constants::IMAGE_SERVICE;
|
||||
use gpui::SharedString;
|
||||
use nostr_sdk::prelude::*;
|
||||
|
||||
use crate::constants::IMAGE_SERVICE;
|
||||
use smallvec::SmallVec;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct NostrProfile {
|
||||
public_key: PublicKey,
|
||||
avatar: SharedString,
|
||||
name: SharedString,
|
||||
pub public_key: PublicKey,
|
||||
pub avatar: SharedString,
|
||||
pub name: SharedString,
|
||||
pub messaging_relays: Option<SmallVec<[RelayUrl; 3]>>,
|
||||
}
|
||||
|
||||
impl NostrProfile {
|
||||
@@ -19,20 +20,14 @@ impl NostrProfile {
|
||||
public_key,
|
||||
name,
|
||||
avatar,
|
||||
messaging_relays: None,
|
||||
}
|
||||
}
|
||||
|
||||
/// Get contact's public key
|
||||
pub fn public_key(&self) -> PublicKey {
|
||||
self.public_key
|
||||
}
|
||||
|
||||
pub fn avatar(&self) -> SharedString {
|
||||
self.avatar.clone()
|
||||
}
|
||||
|
||||
pub fn name(&self) -> SharedString {
|
||||
self.name.clone()
|
||||
/// Set contact's relays
|
||||
pub fn relays(mut self, relays: Option<SmallVec<[RelayUrl; 3]>>) -> Self {
|
||||
self.messaging_relays = relays;
|
||||
self
|
||||
}
|
||||
|
||||
fn extract_avatar(metadata: &Metadata) -> SharedString {
|
||||
|
||||
Reference in New Issue
Block a user