Rename: FromId::from_id07 -> from_id

This commit is contained in:
Kitaiti Makoto
2022-05-02 19:24:36 +09:00
parent 0ab7774e29
commit 28440271bb
12 changed files with 24 additions and 24 deletions
+3 -3
View File
@@ -883,14 +883,14 @@ impl FromId<DbConn> for Post {
.iter()
.fold((None, vec![]), |(blog, mut authors), link| {
if let Some(url) = link.id() {
match User::from_id07(conn, url.as_str(), None, CONFIG.proxy()) {
match User::from_id(conn, url.as_str(), None, CONFIG.proxy()) {
Ok(u) => {
authors.push(u);
(blog, authors)
}
Err(_) => (
blog.or_else(|| {
Blog::from_id07(conn, url.as_str(), None, CONFIG.proxy()).ok()
Blog::from_id(conn, url.as_str(), None, CONFIG.proxy()).ok()
}),
authors,
),
@@ -1155,7 +1155,7 @@ impl AsObject<User, Update07, &DbConn> for PostUpdate {
fn activity07(self, conn: &DbConn, actor: User, _id: &str) -> Result<()> {
let mut post =
Post::from_id07(conn, &self.ap_url, None, CONFIG.proxy()).map_err(|(_, e)| e)?;
Post::from_id(conn, &self.ap_url, None, CONFIG.proxy()).map_err(|(_, e)| e)?;
if !post.is_author(conn, actor.id)? {
// TODO: maybe the author was added in the meantime