refactor(matrix): clean up a few messages
This commit is contained in:
parent
2040eb0078
commit
e2f908a9de
@ -55,7 +55,7 @@ pub async fn login(
|
|||||||
if !fs::try_exists(&root_dir).await.unwrap_or_default()
|
if !fs::try_exists(&root_dir).await.unwrap_or_default()
|
||||||
&& let Err(error) = fs::create_dir_all(&root_dir).await
|
&& let Err(error) = fs::create_dir_all(&root_dir).await
|
||||||
{
|
{
|
||||||
warn!("failed to create directory for matrix sqlite3 store: {error:?}");
|
warn!("failed to create directory for matrix sqlite store: {error:?}");
|
||||||
} else {
|
} else {
|
||||||
builder = builder.sqlite_store(&root_dir, None);
|
builder = builder.sqlite_store(&root_dir, None);
|
||||||
}
|
}
|
||||||
|
@ -30,16 +30,14 @@ async fn confirm_emojis(sas: SasVerification, emoji: [Emoji; 7]) {
|
|||||||
async fn print_devices(user_id: &UserId, client: &Client) -> Result<()> {
|
async fn print_devices(user_id: &UserId, client: &Client) -> Result<()> {
|
||||||
info!("devices of user {user_id}");
|
info!("devices of user {user_id}");
|
||||||
|
|
||||||
|
let own_id = client.device_id().context("missing own device id")?;
|
||||||
for device in client
|
for device in client
|
||||||
.encryption()
|
.encryption()
|
||||||
.get_user_devices(user_id)
|
.get_user_devices(user_id)
|
||||||
.await?
|
.await?
|
||||||
.devices()
|
.devices()
|
||||||
|
.filter(|device| device.device_id() != own_id)
|
||||||
{
|
{
|
||||||
if device.device_id() == client.device_id().context("missing device id")? {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
info!(
|
info!(
|
||||||
"\t{:<10} {:<30} {:<}",
|
"\t{:<10} {:<30} {:<}",
|
||||||
device.device_id(),
|
device.device_id(),
|
||||||
@ -68,13 +66,13 @@ async fn sas_verification_handler(client: Client, sas: SasVerification) -> Resul
|
|||||||
} => {
|
} => {
|
||||||
tokio::spawn(confirm_emojis(
|
tokio::spawn(confirm_emojis(
|
||||||
sas.clone(),
|
sas.clone(),
|
||||||
emojis.context("only emojis supported")?.emojis,
|
emojis.context("only emoji verification supported")?.emojis,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
SasState::Done { .. } => {
|
SasState::Done { .. } => {
|
||||||
let device = sas.other_device();
|
let device = sas.other_device();
|
||||||
info!(
|
info!(
|
||||||
"successfully verified device {} {} trust {:?}",
|
"successfully verified device {} {} with trust {:?}",
|
||||||
device.user_id(),
|
device.user_id(),
|
||||||
device.device_id(),
|
device.device_id(),
|
||||||
device.local_trust_state()
|
device.local_trust_state()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user