about summary refs log tree commit diff
path: root/src/micropub/mod.rs
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2024-07-09 22:43:21 +0300
committerVika <vika@fireburn.ru>2024-07-09 22:44:01 +0300
commit2e9c292bb989ffff2c99aa2a6062962c913b3586 (patch)
tree9c148d9e8fcbd7756ab8d27ae110075beea8e615 /src/micropub/mod.rs
parent644e19aa08b2629d4b69281e14d702f0b9673687 (diff)
database: use Url to represent user authorities
This makes the interface more consistent and resistant to misuse.
Diffstat (limited to 'src/micropub/mod.rs')
-rw-r--r--src/micropub/mod.rs6
1 files changed, 3 insertions, 3 deletions
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<D: 'static + Storage>(
     );
     // 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<D: Storage, A: AuthBackend>(
     );
     match query.q {
         QueryType::Config => {
-            let channels: Vec<MicropubChannel> = match db.get_channels(&user_domain).await {
+            let channels: Vec<MicropubChannel> = match db.get_channels(&user.me).await {
                 Ok(chans) => chans,
                 Err(err) => {
                     return MicropubError::new(
@@ -636,7 +636,7 @@ pub(crate) async fn query<D: Storage, A: AuthBackend>(
                 }
             }
         }
-        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,