mirror of
https://github.com/versia-pub/activitypub.git
synced 2025-12-06 14:48:19 +01:00
fix: post::Model's insert method to remove test code
This commit is contained in:
parent
503e433af3
commit
4c3d06b686
|
|
@ -103,25 +103,6 @@ impl Object for post::Model {
|
||||||
}
|
}
|
||||||
info!("Post inserted: {:?}", post.as_ref().unwrap());
|
info!("Post inserted: {:?}", post.as_ref().unwrap());
|
||||||
|
|
||||||
let post = post.unwrap();
|
Ok(post.unwrap())
|
||||||
|
|
||||||
let mention = Mention {
|
|
||||||
href: Url::parse(&creator.id)?,
|
|
||||||
kind: Default::default(),
|
|
||||||
};
|
|
||||||
let id: ObjectId<post::Model> = generate_object_id(data.domain())?.into();
|
|
||||||
let note = Note {
|
|
||||||
kind: Default::default(),
|
|
||||||
id,
|
|
||||||
sensitive: false,
|
|
||||||
attributed_to: Url::parse(&data.local_user().await?.id).unwrap().into(),
|
|
||||||
to: vec![public()],
|
|
||||||
content: format!("Hello {}", creator.name),
|
|
||||||
in_reply_to: Some(json.id.clone()),
|
|
||||||
tag: vec![mention],
|
|
||||||
};
|
|
||||||
CreatePost::send(note, creator.shared_inbox_or_inbox(), data).await?;
|
|
||||||
|
|
||||||
Ok(post)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue