]> Untitled Git - lemmy.git/blobdiff - crates/apub/src/protocol/activities/mod.rs
Implement federated user following (fixes #752) (#2577)
[lemmy.git] / crates / apub / src / protocol / activities / mod.rs
index 82c5215b4410e1a787ff2943fbdba9b1a8a08287..fcd3153c318410dcb779bd2e91d0d7775402d299 100644 (file)
@@ -8,7 +8,7 @@ pub mod deletion;
 pub mod following;
 pub mod voting;
 
-#[derive(Clone, Debug, Display, Deserialize, Serialize, PartialEq)]
+#[derive(Clone, Debug, Display, Deserialize, Serialize, PartialEq, Eq)]
 pub enum CreateOrUpdateType {
   Create,
   Update,
@@ -21,7 +21,7 @@ mod tests {
       community::announce::AnnounceActivity,
       create_or_update::{comment::CreateOrUpdateComment, post::CreateOrUpdatePost},
       deletion::delete::Delete,
-      following::{follow::FollowCommunity, undo_follow::UndoFollowCommunity},
+      following::{follow::Follow, undo_follow::UndoFollow},
       voting::{undo_vote::UndoVote, vote::Vote},
     },
     tests::test_json,
@@ -36,15 +36,15 @@ mod tests {
   fn test_parse_pleroma_activities() {
     test_json::<CreateOrUpdateComment>("assets/pleroma/activities/create_note.json").unwrap();
     test_json::<Delete>("assets/pleroma/activities/delete.json").unwrap();
-    test_json::<FollowCommunity>("assets/pleroma/activities/follow.json").unwrap();
+    test_json::<Follow>("assets/pleroma/activities/follow.json").unwrap();
   }
 
   #[test]
   fn test_parse_mastodon_activities() {
     test_json::<CreateOrUpdateComment>("assets/mastodon/activities/create_note.json").unwrap();
     test_json::<Delete>("assets/mastodon/activities/delete.json").unwrap();
-    test_json::<FollowCommunity>("assets/mastodon/activities/follow.json").unwrap();
-    test_json::<UndoFollowCommunity>("assets/mastodon/activities/undo_follow.json").unwrap();
+    test_json::<Follow>("assets/mastodon/activities/follow.json").unwrap();
+    test_json::<UndoFollow>("assets/mastodon/activities/undo_follow.json").unwrap();
     test_json::<Vote>("assets/mastodon/activities/like_page.json").unwrap();
     test_json::<UndoVote>("assets/mastodon/activities/undo_like_page.json").unwrap();
   }
@@ -52,6 +52,7 @@ mod tests {
   #[test]
   fn test_parse_lotide_activities() {
     test_json::<CreateOrUpdatePost>("assets/lotide/activities/create_page.json").unwrap();
+    test_json::<CreateOrUpdatePost>("assets/lotide/activities/create_page_image.json").unwrap();
     test_json::<CreateOrUpdateComment>("assets/lotide/activities/create_note_reply.json").unwrap();
   }