This commit is contained in:
2026-08-22 12:25:23 +02:00
parent 8ab3d140fe
commit 1a910d4bd3
6 changed files with 111 additions and 1 deletions
+23
View File
@@ -0,0 +1,23 @@
use std::sync::Arc;
use axum::extract::ws::WebSocket;
use ed25519_dalek::VerifyingKey;
use tokio::sync::Mutex;
use crate::{
protocol::{ClientMethod, send_socket},
server::Server,
};
pub async fn get_users(
server: &Arc<Server>,
_verifying_key: VerifyingKey,
socket: &Arc<Mutex<WebSocket>>,
pubkeys: Vec<String>,
) -> anyhow::Result<()> {
let users = server.user_store.get_users(&pubkeys).await?;
send_socket(&mut *socket.lock().await, &ClientMethod::Users { users }).await?;
Ok(())
}