1 use crate::activities::{
2 comment::create_or_update::CreateOrUpdateComment,
5 announce::AnnounceActivity,
6 block_user::BlockUserFromCommunity,
7 undo_block_user::UndoBlockUserFromCommunity,
8 update::UpdateCommunity,
10 deletion::{delete::DeletePostCommentOrCommunity, undo_delete::UndoDeletePostCommentOrCommunity},
11 following::{accept::AcceptFollowCommunity, follow::FollowCommunity, undo::UndoFollowCommunity},
12 post::create_or_update::CreateOrUpdatePost,
14 create_or_update::CreateOrUpdatePrivateMessage,
15 delete::DeletePrivateMessage,
16 undo_delete::UndoDeletePrivateMessage,
19 remove::RemovePostCommentCommunityOrMod,
20 undo_remove::UndoRemovePostCommentOrCommunity,
22 voting::{undo_vote::UndoVote, vote::Vote},
24 use lemmy_apub_lib::{ActivityCommonFields, ActivityHandler};
25 use lemmy_utils::LemmyError;
26 use lemmy_websocket::LemmyContext;
27 use serde::{Deserialize, Serialize};
29 #[derive(Clone, Debug, Deserialize, Serialize, ActivityHandler)]
31 pub enum PersonInboxActivities {
32 AcceptFollowCommunity(AcceptFollowCommunity),
33 CreateOrUpdatePrivateMessage(CreateOrUpdatePrivateMessage),
34 DeletePrivateMessage(DeletePrivateMessage),
35 UndoDeletePrivateMessage(UndoDeletePrivateMessage),
36 AnnounceActivity(Box<AnnounceActivity>),
39 #[derive(Clone, Debug, Deserialize, Serialize, ActivityHandler)]
41 pub enum GroupInboxActivities {
42 FollowCommunity(FollowCommunity),
43 UndoFollowCommunity(UndoFollowCommunity),
44 CreateOrUpdateComment(CreateOrUpdateComment),
45 CreateOrUpdatePost(Box<CreateOrUpdatePost>),
48 DeletePostCommentOrCommunity(DeletePostCommentOrCommunity),
49 UndoDeletePostCommentOrCommunity(UndoDeletePostCommentOrCommunity),
50 RemovePostCommentOrCommunity(RemovePostCommentCommunityOrMod),
51 UndoRemovePostCommentOrCommunity(UndoRemovePostCommentOrCommunity),
52 UpdateCommunity(Box<UpdateCommunity>),
53 BlockUserFromCommunity(BlockUserFromCommunity),
54 UndoBlockUserFromCommunity(UndoBlockUserFromCommunity),
58 #[derive(Clone, Debug, Deserialize, Serialize, ActivityHandler)]
60 pub enum SharedInboxActivities {
62 FollowCommunity(FollowCommunity),
63 UndoFollowCommunity(UndoFollowCommunity),
64 CreateOrUpdateComment(CreateOrUpdateComment),
65 CreateOrUpdatePost(Box<CreateOrUpdatePost>),
68 DeletePostCommentOrCommunity(DeletePostCommentOrCommunity),
69 UndoDeletePostCommentOrCommunity(UndoDeletePostCommentOrCommunity),
70 RemovePostCommentOrCommunity(RemovePostCommentCommunityOrMod),
71 UndoRemovePostCommentOrCommunity(UndoRemovePostCommentOrCommunity),
72 UpdateCommunity(Box<UpdateCommunity>),
73 BlockUserFromCommunity(BlockUserFromCommunity),
74 UndoBlockUserFromCommunity(UndoBlockUserFromCommunity),
77 AcceptFollowCommunity(AcceptFollowCommunity),
78 // Note, pm activities need to be at the end, otherwise comments will end up here. We can probably
79 // avoid this problem by replacing createpm.object with our own struct, instead of NoteExt.
80 CreateOrUpdatePrivateMessage(CreateOrUpdatePrivateMessage),
81 DeletePrivateMessage(DeletePrivateMessage),
82 UndoDeletePrivateMessage(UndoDeletePrivateMessage),
83 AnnounceActivity(Box<AnnounceActivity>),