1 use crate::activities::{
2 comment::{create::CreateComment, update::UpdateComment},
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::CreatePost, update::UpdatePost},
14 create::CreatePrivateMessage,
15 delete::DeletePrivateMessage,
16 undo_delete::UndoDeletePrivateMessage,
17 update::UpdatePrivateMessage,
20 remove::RemovePostCommentCommunityOrMod,
21 undo_remove::UndoRemovePostCommentOrCommunity,
24 dislike::DislikePostOrComment,
25 like::LikePostOrComment,
26 undo_dislike::UndoDislikePostOrComment,
27 undo_like::UndoLikePostOrComment,
30 use lemmy_apub_lib::{ActivityCommonFields, ActivityHandler};
31 use lemmy_utils::LemmyError;
32 use lemmy_websocket::LemmyContext;
33 use serde::{Deserialize, Serialize};
35 #[derive(Clone, Debug, Deserialize, Serialize, ActivityHandler)]
37 pub enum PersonInboxActivities {
38 AcceptFollowCommunity(AcceptFollowCommunity),
39 CreatePrivateMessage(CreatePrivateMessage),
40 UpdatePrivateMessage(UpdatePrivateMessage),
41 DeletePrivateMessage(DeletePrivateMessage),
42 UndoDeletePrivateMessage(UndoDeletePrivateMessage),
43 AnnounceActivity(Box<AnnounceActivity>),
46 #[derive(Clone, Debug, Deserialize, Serialize, ActivityHandler)]
48 pub enum GroupInboxActivities {
49 FollowCommunity(FollowCommunity),
50 UndoFollowCommunity(UndoFollowCommunity),
51 CreateComment(CreateComment),
52 UpdateComment(UpdateComment),
53 CreatePost(CreatePost),
54 UpdatePost(UpdatePost),
55 LikePostOrComment(LikePostOrComment),
56 DislikePostOrComment(DislikePostOrComment),
57 UndoLikePostOrComment(UndoLikePostOrComment),
58 UndoDislikePostOrComment(UndoDislikePostOrComment),
59 DeletePostCommentOrCommunity(DeletePostCommentOrCommunity),
60 UndoDeletePostCommentOrCommunity(UndoDeletePostCommentOrCommunity),
61 RemovePostCommentOrCommunity(RemovePostCommentCommunityOrMod),
62 UndoRemovePostCommentOrCommunity(UndoRemovePostCommentOrCommunity),
63 UpdateCommunity(Box<UpdateCommunity>),
64 BlockUserFromCommunity(BlockUserFromCommunity),
65 UndoBlockUserFromCommunity(UndoBlockUserFromCommunity),
69 #[derive(Clone, Debug, Deserialize, Serialize, ActivityHandler)]
71 pub enum SharedInboxActivities {
73 FollowCommunity(FollowCommunity),
74 UndoFollowCommunity(UndoFollowCommunity),
75 CreateComment(CreateComment),
76 UpdateComment(UpdateComment),
77 CreatePost(CreatePost),
78 UpdatePost(UpdatePost),
79 LikePostOrComment(LikePostOrComment),
80 DislikePostOrComment(DislikePostOrComment),
81 UndoDislikePostOrComment(UndoDislikePostOrComment),
82 UndoLikePostOrComment(UndoLikePostOrComment),
83 DeletePostCommentOrCommunity(DeletePostCommentOrCommunity),
84 UndoDeletePostCommentOrCommunity(UndoDeletePostCommentOrCommunity),
85 RemovePostCommentOrCommunity(RemovePostCommentCommunityOrMod),
86 UndoRemovePostCommentOrCommunity(UndoRemovePostCommentOrCommunity),
87 UpdateCommunity(Box<UpdateCommunity>),
88 BlockUserFromCommunity(BlockUserFromCommunity),
89 UndoBlockUserFromCommunity(UndoBlockUserFromCommunity),
92 AcceptFollowCommunity(AcceptFollowCommunity),
93 // Note, pm activities need to be at the end, otherwise comments will end up here. We can probably
94 // avoid this problem by replacing createpm.object with our own struct, instead of NoteExt.
95 CreatePrivateMessage(CreatePrivateMessage),
96 UpdatePrivateMessage(UpdatePrivateMessage),
97 DeletePrivateMessage(DeletePrivateMessage),
98 UndoDeletePrivateMessage(UndoDeletePrivateMessage),
99 AnnounceActivity(Box<AnnounceActivity>),