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,
23 dislike::DislikePostOrComment,
24 like::LikePostOrComment,
25 undo_dislike::UndoDislikePostOrComment,
26 undo_like::UndoLikePostOrComment,
29 use lemmy_apub_lib::{ActivityCommonFields, ActivityHandler};
30 use lemmy_utils::LemmyError;
31 use lemmy_websocket::LemmyContext;
32 use serde::{Deserialize, Serialize};
34 #[derive(Clone, Debug, Deserialize, Serialize, ActivityHandler)]
36 pub enum PersonInboxActivities {
37 AcceptFollowCommunity(AcceptFollowCommunity),
38 CreateOrUpdatePrivateMessage(CreateOrUpdatePrivateMessage),
39 DeletePrivateMessage(DeletePrivateMessage),
40 UndoDeletePrivateMessage(UndoDeletePrivateMessage),
41 AnnounceActivity(Box<AnnounceActivity>),
44 #[derive(Clone, Debug, Deserialize, Serialize, ActivityHandler)]
46 pub enum GroupInboxActivities {
47 FollowCommunity(FollowCommunity),
48 UndoFollowCommunity(UndoFollowCommunity),
49 CreateOrUpdateComment(CreateOrUpdateComment),
50 CreateOrUpdatePost(Box<CreateOrUpdatePost>),
51 LikePostOrComment(LikePostOrComment),
52 DislikePostOrComment(DislikePostOrComment),
53 UndoLikePostOrComment(UndoLikePostOrComment),
54 UndoDislikePostOrComment(UndoDislikePostOrComment),
55 DeletePostCommentOrCommunity(DeletePostCommentOrCommunity),
56 UndoDeletePostCommentOrCommunity(UndoDeletePostCommentOrCommunity),
57 RemovePostCommentOrCommunity(RemovePostCommentCommunityOrMod),
58 UndoRemovePostCommentOrCommunity(UndoRemovePostCommentOrCommunity),
59 UpdateCommunity(Box<UpdateCommunity>),
60 BlockUserFromCommunity(BlockUserFromCommunity),
61 UndoBlockUserFromCommunity(UndoBlockUserFromCommunity),
65 #[derive(Clone, Debug, Deserialize, Serialize, ActivityHandler)]
67 pub enum SharedInboxActivities {
69 FollowCommunity(FollowCommunity),
70 UndoFollowCommunity(UndoFollowCommunity),
71 CreateOrUpdateComment(CreateOrUpdateComment),
72 CreateOrUpdatePost(Box<CreateOrUpdatePost>),
73 LikePostOrComment(LikePostOrComment),
74 DislikePostOrComment(DislikePostOrComment),
75 UndoDislikePostOrComment(UndoDislikePostOrComment),
76 UndoLikePostOrComment(UndoLikePostOrComment),
77 DeletePostCommentOrCommunity(DeletePostCommentOrCommunity),
78 UndoDeletePostCommentOrCommunity(UndoDeletePostCommentOrCommunity),
79 RemovePostCommentOrCommunity(RemovePostCommentCommunityOrMod),
80 UndoRemovePostCommentOrCommunity(UndoRemovePostCommentOrCommunity),
81 UpdateCommunity(Box<UpdateCommunity>),
82 BlockUserFromCommunity(BlockUserFromCommunity),
83 UndoBlockUserFromCommunity(UndoBlockUserFromCommunity),
86 AcceptFollowCommunity(AcceptFollowCommunity),
87 // Note, pm activities need to be at the end, otherwise comments will end up here. We can probably
88 // avoid this problem by replacing createpm.object with our own struct, instead of NoteExt.
89 CreateOrUpdatePrivateMessage(CreateOrUpdatePrivateMessage),
90 DeletePrivateMessage(DeletePrivateMessage),
91 UndoDeletePrivateMessage(UndoDeletePrivateMessage),
92 AnnounceActivity(Box<AnnounceActivity>),