about summary refs log tree commit diff
path: root/kittybox-rs/src/micropub
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2023-06-22 22:18:24 +0300
committerVika <vika@fireburn.ru>2023-06-22 22:18:24 +0300
commitbf499c9351cdfa88002cc7eaf2f695b0683efa5b (patch)
tree72419f8f201fcb9330c4dce81e075be1e8561ba9 /kittybox-rs/src/micropub
parent858c0ddd9cc36af0acc72efb1ff1bdc1d8e28b0a (diff)
downloadkittybox-bf499c9351cdfa88002cc7eaf2f695b0683efa5b.tar.zst
database: add add_to_feed and remove_from_feed
Some database backends may have optimized ways of tracking feed
contents. Others might just use the "children" property directly.
Diffstat (limited to 'kittybox-rs/src/micropub')
-rw-r--r--kittybox-rs/src/micropub/mod.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/kittybox-rs/src/micropub/mod.rs b/kittybox-rs/src/micropub/mod.rs
index 5c297f9..da9c6a5 100644
--- a/kittybox-rs/src/micropub/mod.rs
+++ b/kittybox-rs/src/micropub/mod.rs
@@ -294,8 +294,7 @@ pub(crate) async fn _post<D: 'static + Storage>(
 
     for chan in &mut channels {
         if db.post_exists(chan).await? {
-            db.update_post(chan, json!({"add": {"children": [uid]}}))
-                .await?;
+            db.add_to_feed(chan, &uid).await?;
         } else if default_channels.iter().any(|i| chan == i) {
             util::create_feed(&db, &uid, chan, user).await?;
         } else {