mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-23 03:51:00 +00:00
Implement Mention::build_delete07()
This commit is contained in:
parent
98e0754976
commit
3e9d9a81b7
1 changed files with 19 additions and 2 deletions
|
@ -10,11 +10,11 @@ use activitypub::{
|
||||||
CustomObject,
|
CustomObject,
|
||||||
};
|
};
|
||||||
use activitystreams::{
|
use activitystreams::{
|
||||||
activity::{Create as Create07, Update as Update07},
|
activity::{Create as Create07, Delete as Delete07, Update as Update07},
|
||||||
base::{AnyBase, Base},
|
base::{AnyBase, Base},
|
||||||
iri_string::types::IriString,
|
iri_string::types::IriString,
|
||||||
link as link07,
|
link as link07,
|
||||||
object::{ApObject, Article as Article07, Image as Image07},
|
object::{ApObject, Article as Article07, Image as Image07, Tombstone as Tombstone07},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
time::OffsetDateTime,
|
time::OffsetDateTime,
|
||||||
};
|
};
|
||||||
|
@ -811,6 +811,23 @@ impl Post {
|
||||||
Ok(act)
|
Ok(act)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn build_delete07(&self, conn: &Connection) -> Result<Delete07> {
|
||||||
|
let mut tombstone = Tombstone07::new();
|
||||||
|
tombstone.set_id(self.ap_url.parse()?);
|
||||||
|
|
||||||
|
let mut act = Delete07::new(
|
||||||
|
self.get_authors(conn)?[0]
|
||||||
|
.clone()
|
||||||
|
.into_id()
|
||||||
|
.parse::<IriString>()?,
|
||||||
|
Base::retract(tombstone)?.into_generic()?,
|
||||||
|
);
|
||||||
|
|
||||||
|
act.set_id(format!("{}#delete", self.ap_url).parse()?);
|
||||||
|
act.set_many_tos(vec![PUBLIC_VISIBILITY.parse::<IriString>()?]);
|
||||||
|
Ok(act)
|
||||||
|
}
|
||||||
|
|
||||||
fn publish_published(&self) {
|
fn publish_published(&self) {
|
||||||
POST_CHAN.tell(
|
POST_CHAN.tell(
|
||||||
Publish {
|
Publish {
|
||||||
|
|
Loading…
Reference in a new issue