Skip to content

Commit

Permalink
chore: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dariusc93 committed Oct 7, 2023
1 parent 27b566e commit 6c5cc59
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
19 changes: 2 additions & 17 deletions extensions/warp-ipfs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,35 +451,20 @@ impl WarpIpfs {
relays.clone(),
);

info!("Initializing identity profile");
let identity_store = IdentityStore::new(
ipfs.clone(),
config.path.clone(),
tesseract.clone(),
config.store_setting.auto_push,
self.multipass_tx.clone(),
pb_tx,
&config,
discovery.clone(),
)
.await?;
info!("Identity store initialized");

// let friend_store = FriendsStore::new(
// ipfs.clone(),
// identity_store.clone(),
// discovery.clone(),
// config.clone(),
// tesseract.clone(),
// self.multipass_tx.clone(),
//
// )
// .await?;
// info!("friends store initialized");

// identity_store.set_friend_store(friend_store.clone()).await;
info!("Identity initialized");

*self.identity_store.write() = Some(identity_store.clone());
// *self.friend_store.write() = Some(friend_store.clone());

*self.ipfs.write() = Some(ipfs.clone());

Expand Down
11 changes: 7 additions & 4 deletions extensions/warp-ipfs/src/store/identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ use super::{
};

#[derive(Clone)]
#[allow(clippy::type_complexity)]
pub struct IdentityStore {
ipfs: Ipfs,

Expand Down Expand Up @@ -238,7 +239,6 @@ impl IdentityStore {
ipfs: Ipfs,
path: Option<PathBuf>,
tesseract: Tesseract,
interval: Option<Duration>,
tx: broadcast::Sender<MultiPassEventKind>,
pb_tx: futures::channel::mpsc::Sender<PhoneBookCommand>,
config: &config::Config,
Expand Down Expand Up @@ -357,9 +357,12 @@ impl IdentityStore {
futures::pin_mut!(event_stream);
futures::pin_mut!(friend_stream);

let auto_push = interval.is_some();
let auto_push = store.config.store_setting.auto_push.is_some();

let interval = interval
let interval = store
.config
.store_setting
.auto_push
.map(|i| {
if i.as_millis() < 300000 {
Duration::from_millis(300000)
Expand Down Expand Up @@ -2829,7 +2832,7 @@ impl IdentityStore {
}

if broadcast {
let local_public_key = (&*self.did_key).clone();
let local_public_key = (*self.did_key).clone();

let payload = RequestResponsePayload {
sender: local_public_key,
Expand Down

0 comments on commit 6c5cc59

Please sign in to comment.