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::Delete, undo_delete::UndoDelete},
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,
18 removal::{remove::RemoveMod, undo_remove::UndoRemovePostCommentOrCommunity},
19 voting::{undo_vote::UndoVote, vote::Vote},
21 use lemmy_apub_lib::{ActivityCommonFields, ActivityHandler};
22 use lemmy_utils::LemmyError;
23 use lemmy_websocket::LemmyContext;
24 use serde::{Deserialize, Serialize};
26 #[derive(Clone, Debug, Deserialize, Serialize, ActivityHandler)]
28 pub enum PersonInboxActivities {
29 AcceptFollowCommunity(AcceptFollowCommunity),
30 CreateOrUpdatePrivateMessage(CreateOrUpdatePrivateMessage),
31 DeletePrivateMessage(DeletePrivateMessage),
32 UndoDeletePrivateMessage(UndoDeletePrivateMessage),
33 AnnounceActivity(Box<AnnounceActivity>),
36 #[derive(Clone, Debug, Deserialize, Serialize, ActivityHandler)]
38 pub enum GroupInboxActivities {
39 FollowCommunity(FollowCommunity),
40 UndoFollowCommunity(UndoFollowCommunity),
41 CreateOrUpdateComment(CreateOrUpdateComment),
42 CreateOrUpdatePost(Box<CreateOrUpdatePost>),
45 DeletePostCommentOrCommunity(Delete),
46 UndoDeletePostCommentOrCommunity(UndoDelete),
47 UndoRemovePostCommentOrCommunity(UndoRemovePostCommentOrCommunity),
48 UpdateCommunity(Box<UpdateCommunity>),
49 BlockUserFromCommunity(BlockUserFromCommunity),
50 UndoBlockUserFromCommunity(UndoBlockUserFromCommunity),
55 #[derive(Clone, Debug, Deserialize, Serialize, ActivityHandler)]
57 pub enum SharedInboxActivities {
59 FollowCommunity(FollowCommunity),
60 UndoFollowCommunity(UndoFollowCommunity),
61 CreateOrUpdateComment(CreateOrUpdateComment),
62 CreateOrUpdatePost(Box<CreateOrUpdatePost>),
66 UndoDelete(UndoDelete),
67 UndoRemovePostCommentOrCommunity(UndoRemovePostCommentOrCommunity),
68 UpdateCommunity(Box<UpdateCommunity>),
69 BlockUserFromCommunity(BlockUserFromCommunity),
70 UndoBlockUserFromCommunity(UndoBlockUserFromCommunity),
74 AcceptFollowCommunity(AcceptFollowCommunity),
75 // Note, pm activities need to be at the end, otherwise comments will end up here. We can probably
76 // avoid this problem by replacing createpm.object with our own struct, instead of NoteExt.
77 CreateOrUpdatePrivateMessage(CreateOrUpdatePrivateMessage),
78 DeletePrivateMessage(DeletePrivateMessage),
79 UndoDeletePrivateMessage(UndoDeletePrivateMessage),
80 AnnounceActivity(Box<AnnounceActivity>),