1 use crate::activities::{
2 community::remove_mod::RemoveMod,
3 deletion::{undo_delete::UndoDelete, verify_delete_activity},
7 activity::kind::UndoType,
12 use lemmy_apub_lib::{values::PublicUrl, ActivityFields, ActivityHandler};
13 use lemmy_utils::LemmyError;
14 use lemmy_websocket::LemmyContext;
15 use serde::{Deserialize, Serialize};
18 #[derive(Clone, Debug, Deserialize, Serialize, ActivityFields)]
19 #[serde(rename_all = "camelCase")]
20 pub struct UndoRemovePostCommentOrCommunity {
23 // Note, there is no such thing as Undo/Remove/Mod, so we ignore that
26 #[serde(rename = "type")]
29 #[serde(rename = "@context")]
30 context: OneOrMany<AnyBase>,
35 #[async_trait::async_trait(?Send)]
36 impl ActivityHandler for UndoRemovePostCommentOrCommunity {
39 context: &LemmyContext,
40 request_counter: &mut i32,
41 ) -> Result<(), LemmyError> {
42 verify_activity(self)?;
43 self.object.verify(context, request_counter).await?;
45 verify_delete_activity(
59 context: &LemmyContext,
60 _request_counter: &mut i32,
61 ) -> Result<(), LemmyError> {
62 UndoDelete::receive_undo_remove_action(&self.object.object, context).await