objects::community::ApubCommunity,
protocol::{
activities::{
+ block::{block_user::BlockUser, undo_block_user::UndoBlockUser},
community::{
add_mod::AddMod,
announce::AnnounceActivity,
- block_user::BlockUserFromCommunity,
remove_mod::RemoveMod,
report::Report,
- undo_block_user::UndoBlockUserFromCommunity,
update::UpdateCommunity,
},
create_or_update::{comment::CreateOrUpdateComment, post::CreateOrUpdatePost},
},
voting::{undo_vote::UndoVote, vote::Vote},
},
- objects::{note::Note, page::Page},
+ objects::page::Page,
},
};
use lemmy_apub_lib::traits::ActivityHandler;
Delete(Delete),
UndoDelete(UndoDelete),
UpdateCommunity(UpdateCommunity),
- BlockUserFromCommunity(BlockUserFromCommunity),
- UndoBlockUserFromCommunity(UndoBlockUserFromCommunity),
+ BlockUser(BlockUser),
+ UndoBlockUser(UndoBlockUser),
AddMod(AddMod),
RemoveMod(RemoveMod),
// For compatibility with Pleroma/Mastodon (send only)
Page(Page),
- // For compatibility with Pleroma/Mastodon (send only)
- Note(Note),
+}
+
+#[derive(Clone, Debug, Deserialize, Serialize, ActivityHandler)]
+#[serde(untagged)]
+#[activity_handler(LemmyContext)]
+pub enum SiteInboxActivities {
+ BlockUser(BlockUser),
+ UndoBlockUser(UndoBlockUser),
}
#[async_trait::async_trait(?Send)]
impl GetCommunity for AnnouncableActivities {
+ #[tracing::instrument(skip(self, context))]
async fn get_community(
&self,
context: &LemmyContext,
Delete(a) => a.get_community(context, request_counter).await?,
UndoDelete(a) => a.get_community(context, request_counter).await?,
UpdateCommunity(a) => a.get_community(context, request_counter).await?,
- BlockUserFromCommunity(a) => a.get_community(context, request_counter).await?,
- UndoBlockUserFromCommunity(a) => a.get_community(context, request_counter).await?,
+ BlockUser(a) => a.get_community(context, request_counter).await?,
+ UndoBlockUser(a) => a.get_community(context, request_counter).await?,
AddMod(a) => a.get_community(context, request_counter).await?,
RemoveMod(a) => a.get_community(context, request_counter).await?,
Page(_) => unimplemented!(),
- Note(_) => unimplemented!(),
};
Ok(community)
}