From bf499c9351cdfa88002cc7eaf2f695b0683efa5b Mon Sep 17 00:00:00 2001 From: Vika Date: Thu, 22 Jun 2023 22:18:24 +0300 Subject: 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. --- kittybox-rs/src/micropub/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'kittybox-rs/src/micropub/mod.rs') 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( 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 { -- cgit 1.4.1