Use previously saved sync token to save time
This commit is contained in:
parent
b2df4ff0ef
commit
6c2f601300
|
@ -74,10 +74,15 @@ pub async fn status() -> CommandResult {
|
||||||
|
|
||||||
pub async fn list_rooms() -> CommandResult {
|
pub async fn list_rooms() -> CommandResult {
|
||||||
let client = restore_session().await?;
|
let client = restore_session().await?;
|
||||||
|
let mut sync_settings = SyncSettings::new();
|
||||||
|
if let Some(token) = client.sync_token().await {
|
||||||
|
sync_settings = sync_settings.token(token);
|
||||||
|
}
|
||||||
|
|
||||||
println!("Syncing...");
|
print!("Syncing...");
|
||||||
client.sync_once(SyncSettings::default()).await?;
|
io::stderr().flush().unwrap();
|
||||||
println!(" ...done");
|
client.sync_once(sync_settings).await?;
|
||||||
|
println!(" done");
|
||||||
|
|
||||||
println!("Joined rooms:");
|
println!("Joined rooms:");
|
||||||
println!(room_fmt!(), "Name", "Main alias", "Room ID");
|
println!(room_fmt!(), "Name", "Main alias", "Room ID");
|
||||||
|
|
Loading…
Reference in New Issue