Watch
0
0
Fork
You've already forked hyperhive
0

swarm-controller: log matrix accounts in and out through swarm-matrix-client

Adds password_login and logout to swarm-matrix-client and deletes the controller's private copies, with their own timeouts and error text.
This commit is contained in:
atlas 2026-10-17 16:45:55 +02:00 • committed by mara
commit d7e48091ca
6 changed files with 300 additions and 179 deletions

View file

@ -462,7 +462,11 @@ pub async fn delete_matrix_account(
let revoke = query
.revoke
.then_some(|homeserver: String, token: String| async move {
crate::matrix_account::matrix_logout(&homeserver, &token).await
let http = swarm_matrix_client::client().map_err(|e| format!("{e:#}"))?;
let base = homeserver.trim_end_matches('/');
swarm_matrix_client::logout(&http, base, &token)
.await
.map_err(|e| format!("{e:#}"))
});
remove_matrix(&store, &path, revoke).await.map_err(|e| {
tracing::warn!(%hive, %agent, %account, error = ?e, "deleting the matrix account failed");