1 use crate::activities::{
2 deletion::{undo_delete::UndoDelete, verify_delete_activity},
3 removal::remove::RemoveMod,
6 use activitystreams::activity::kind::UndoType;
7 use lemmy_apub_lib::{values::PublicUrl, ActivityCommonFields, ActivityHandler};
8 use lemmy_utils::LemmyError;
9 use lemmy_websocket::LemmyContext;
12 #[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
13 #[serde(rename_all = "camelCase")]
14 pub struct UndoRemovePostCommentOrCommunity {
16 // Note, there is no such thing as Undo/Remove/Mod, so we ignore that
19 #[serde(rename = "type")]
22 common: ActivityCommonFields,
25 #[async_trait::async_trait(?Send)]
26 impl ActivityHandler for UndoRemovePostCommentOrCommunity {
29 context: &LemmyContext,
30 request_counter: &mut i32,
31 ) -> Result<(), LemmyError> {
32 verify_activity(self.common())?;
33 self.object.verify(context, request_counter).await?;
35 verify_delete_activity(
49 context: &LemmyContext,
50 _request_counter: &mut i32,
51 ) -> Result<(), LemmyError> {
52 UndoDelete::receive_undo_remove_action(&self.object.object, context).await
55 fn common(&self) -> &ActivityCommonFields {