Handle sync failure after successful password entry (#133)
This commit is contained in:
22
src/main.rs
22
src/main.rs
@@ -17,7 +17,13 @@ use clap::Parser;
|
||||
use tokio::sync::Mutex as AsyncMutex;
|
||||
use tracing_subscriber::FmtSubscriber;
|
||||
|
||||
use matrix_sdk::ruma::OwnedUserId;
|
||||
use matrix_sdk::{
|
||||
config::SyncSettings,
|
||||
ruma::{
|
||||
api::client::filter::{FilterDefinition, LazyLoadOptions, RoomEventFilter, RoomFilter},
|
||||
OwnedUserId,
|
||||
},
|
||||
};
|
||||
|
||||
use modalkit::crossterm::{
|
||||
self,
|
||||
@@ -644,6 +650,20 @@ async fn login(worker: Requester, settings: &ApplicationSettings) -> IambResult<
|
||||
}
|
||||
}
|
||||
|
||||
// Perform an initial, lazily-loaded sync.
|
||||
let mut room = RoomEventFilter::default();
|
||||
room.lazy_load_options = LazyLoadOptions::Enabled { include_redundant_members: false };
|
||||
|
||||
let mut room_ev = RoomFilter::default();
|
||||
room_ev.state = room;
|
||||
|
||||
let mut filter = FilterDefinition::default();
|
||||
filter.room = room_ev;
|
||||
|
||||
let settings = SyncSettings::new().filter(filter.into());
|
||||
|
||||
worker.client.sync_once(settings).await.map_err(IambError::from)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user