mirror of
https://github.com/Nutomic/ibis.git
synced 2024-12-26 00:41:24 +00:00
Use Patch
type for federation
This commit is contained in:
parent
5c969078a8
commit
98c6726b84
1 changed files with 6 additions and 4 deletions
|
@ -9,16 +9,18 @@ use activitypub_federation::traits::Object;
|
|||
use serde::{Deserialize, Serialize};
|
||||
use url::Url;
|
||||
|
||||
/// Same type used by Forgefed
|
||||
/// https://codeberg.org/ForgeFed/ForgeFed/issues/88
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
pub enum EditType {
|
||||
Edit,
|
||||
pub enum PatchType {
|
||||
Patch,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Debug, Clone)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ApubEdit {
|
||||
#[serde(rename = "type")]
|
||||
kind: EditType,
|
||||
kind: PatchType,
|
||||
pub id: ObjectId<DbEdit>,
|
||||
pub content: String,
|
||||
pub version: EditVersion,
|
||||
|
@ -42,7 +44,7 @@ impl Object for DbEdit {
|
|||
async fn into_json(self, data: &Data<Self::DataType>) -> Result<Self::Kind, Self::Error> {
|
||||
let article = DbArticle::read(self.article_id, &data.db_connection)?;
|
||||
Ok(ApubEdit {
|
||||
kind: EditType::Edit,
|
||||
kind: PatchType::Patch,
|
||||
id: self.ap_id,
|
||||
content: self.diff,
|
||||
version: self.hash,
|
||||
|
|
Loading…
Reference in a new issue