From 864379fb81ae547a698d63bfabc20973defdec7b Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Thu, 7 Jan 2021 22:38:50 +0900 Subject: [PATCH] Remove searcher from arguments of Post::update() --- plume-models/src/posts.rs | 5 ++--- src/routes/posts.rs | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/plume-models/src/posts.rs b/plume-models/src/posts.rs index 9045839d..a71b8a49 100644 --- a/plume-models/src/posts.rs +++ b/plume-models/src/posts.rs @@ -85,7 +85,7 @@ impl Post { Ok(post) } - pub fn update(&self, conn: &Connection, _searcher: &Searcher) -> Result { + pub fn update(&self, conn: &Connection) -> Result { diesel::update(self).set(self).execute(conn)?; let post = Self::get(conn, self.id)?; // TODO: Call publish_published() when newly published @@ -750,7 +750,6 @@ impl AsObject for PostUpdate { fn activity(self, c: &PlumeRocket, actor: User, _id: &str) -> Result<()> { let conn = &*c.conn; - let searcher = &c.searcher; let mut post = Post::from_id(c, &self.ap_url, None, CONFIG.proxy()).map_err(|(_, e)| e)?; if !post.is_author(conn, actor.id)? { @@ -812,7 +811,7 @@ impl AsObject for PostUpdate { post.update_hashtags(conn, hashtags)?; } - post.update(conn, searcher)?; + post.update(conn)?; Ok(()) } } diff --git a/src/routes/posts.rs b/src/routes/posts.rs index b1e408f4..f76100b1 100644 --- a/src/routes/posts.rs +++ b/src/routes/posts.rs @@ -298,8 +298,7 @@ pub fn update( post.source = form.content.clone(); post.license = form.license.clone(); post.cover_id = form.cover; - post.update(&*conn, &rockets.searcher) - .expect("post::update: update error"); + post.update(&*conn).expect("post::update: update error"); if post.published { post.update_mentions(