From 2e9c292bb989ffff2c99aa2a6062962c913b3586 Mon Sep 17 00:00:00 2001 From: Vika Date: Tue, 9 Jul 2024 22:43:21 +0300 Subject: database: use Url to represent user authorities This makes the interface more consistent and resistant to misuse. --- src/micropub/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/micropub/mod.rs') diff --git a/src/micropub/mod.rs b/src/micropub/mod.rs index 8f7ff90..74f53a0 100644 --- a/src/micropub/mod.rs +++ b/src/micropub/mod.rs @@ -292,7 +292,7 @@ pub(crate) async fn _post( ); // Save the post tracing::debug!("Saving post to database..."); - db.put_post(&mf2, &user_domain).await?; + db.put_post(&mf2, &user.me).await?; let mut channels = mf2["properties"]["channel"] .as_array() @@ -579,7 +579,7 @@ pub(crate) async fn query( ); match query.q { QueryType::Config => { - let channels: Vec = match db.get_channels(&user_domain).await { + let channels: Vec = match db.get_channels(&user.me).await { Ok(chans) => chans, Err(err) => { return MicropubError::new( @@ -636,7 +636,7 @@ pub(crate) async fn query( } } } - QueryType::Channel => match db.get_channels(&user_domain).await { + QueryType::Channel => match db.get_channels(&user.me).await { Ok(chans) => axum::response::Json(json!({ "channels": chans })).into_response(), Err(err) => MicropubError::new( ErrorType::InternalServerError, -- cgit 1.4.1