Remove searcher from arguments of Post::update()

This commit is contained in:
Kitaiti Makoto 2021-01-07 22:38:50 +09:00
parent aae2073146
commit 864379fb81
2 changed files with 3 additions and 5 deletions

View file

@ -85,7 +85,7 @@ impl Post {
Ok(post)
}
pub fn update(&self, conn: &Connection, _searcher: &Searcher) -> Result<Self> {
pub fn update(&self, conn: &Connection) -> Result<Self> {
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<User, Update, &PlumeRocket> 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<User, Update, &PlumeRocket> for PostUpdate {
post.update_hashtags(conn, hashtags)?;
}
post.update(conn, searcher)?;
post.update(conn)?;
Ok(())
}
}

View file

@ -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(