]> Untitled Git - lemmy.git/commitdiff
Federate votes as private (#2501)
authorNutomic <me@nutomic.com>
Tue, 18 Oct 2022 03:13:18 +0000 (03:13 +0000)
committerGitHub <noreply@github.com>
Tue, 18 Oct 2022 03:13:18 +0000 (03:13 +0000)
crates/apub/assets/lemmy/activities/voting/dislike_page.json
crates/apub/assets/lemmy/activities/voting/like_note.json
crates/apub/assets/lemmy/activities/voting/undo_dislike_page.json
crates/apub/assets/lemmy/activities/voting/undo_like_note.json
crates/apub/src/activities/voting/undo_vote.rs
crates/apub/src/activities/voting/vote.rs
crates/apub/src/protocol/activities/voting/undo_vote.rs
crates/apub/src/protocol/activities/voting/vote.rs

index dbf1eda788e09a5958fba0781b087c6dabd65776..0917329e75469c8d66a9f436efd563ef1902cc72 100644 (file)
@@ -1,9 +1,6 @@
 {
   "actor": "http://enterprise.lemmy.ml/u/lemmy_beta",
   "object": "http://ds9.lemmy.ml/post/1",
-  "cc": [
-    "https://www.w3.org/ns/activitystreams#Public"
-  ],
   "type": "Dislike",
   "id": "http://enterprise.lemmy.ml/activities/dislike/64d40d40-a829-43a5-8247-1fb595b3ca1c"
 }
\ No newline at end of file
index 0ce7f2aae7fcece04675130eea18a8681bfaa78e..78ee5b12bc9b596f0654b810ff979014fcc2c3e5 100644 (file)
@@ -1,9 +1,6 @@
 {
   "actor": "http://ds9.lemmy.ml/u/lemmy_alpha",
   "object": "http://ds9.lemmy.ml/comment/1",
-  "cc": [
-    "https://www.w3.org/ns/activitystreams#Public"
-  ],
   "type": "Like",
   "id": "http://ds9.lemmy.ml/activities/like/fd61d070-7382-46a9-b2b7-6bb253732877"
 }
\ No newline at end of file
index fe708971c75c13f8b8548b1d2081da6ad5c82c2f..54fc19039e56d76c8864e7180d8996a111324c72 100644 (file)
@@ -3,15 +3,9 @@
   "object": {
     "actor": "http://enterprise.lemmy.ml/u/lemmy_beta",
     "object": "http://ds9.lemmy.ml/post/1",
-    "cc": [
-      "https://www.w3.org/ns/activitystreams#Public"
-    ],
     "type": "Like",
     "id": "http://enterprise.lemmy.ml/activities/like/2227ab2c-79e2-4fca-a1d2-1d67dacf2457"
   },
-  "cc": [
-    "https://www.w3.org/ns/activitystreams#Public"
-  ],
   "type": "Undo",
   "id": "http://enterprise.lemmy.ml/activities/undo/6cc6fb71-39fe-49ea-9506-f0423b101e98"
 }
\ No newline at end of file
index 369c814ca97b372f18dfb58872eac47b4de6c174..65ed510eb064076bca5ec49415a05ca98f5463c8 100644 (file)
@@ -3,15 +3,9 @@
   "object": {
     "actor": "http://ds9.lemmy.ml/u/lemmy_alpha",
     "object": "http://ds9.lemmy.ml/comment/1",
-    "cc": [
-      "https://www.w3.org/ns/activitystreams#Public"
-    ],
     "type": "Like",
     "id": "http://ds9.lemmy.ml/activities/like/efcf7ae2-dfcc-4ff4-9ce4-6adf251ff004"
   },
-  "cc": [
-    "https://www.w3.org/ns/activitystreams#Public"
-  ],
   "type": "Undo",
   "id": "http://ds9.lemmy.ml/activities/undo/3518565c-24a7-4d9e-8e0a-f7a2f45ac618"
 }
\ No newline at end of file
index 69abdac51b1e25608c52cab1af0ab9695496b1e0..f6fc36a2de7e8ca8ee00c846698983ce846c847d 100644 (file)
@@ -21,7 +21,7 @@ use activitypub_federation::{
   traits::ActivityHandler,
   utils::verify_urls_match,
 };
-use activitystreams_kinds::{activity::UndoType, public};
+use activitystreams_kinds::activity::UndoType;
 use lemmy_api_common::utils::blocking;
 use lemmy_db_schema::{newtypes::CommunityId, source::community::Community, traits::Crud};
 use lemmy_utils::error::LemmyError;
@@ -54,7 +54,6 @@ impl UndoVote {
     let undo_vote = UndoVote {
       actor: ObjectId::new(actor.actor_id()),
       object,
-      cc: vec![public()],
       kind: UndoType::Undo,
       id: id.clone(),
       unparsed: Default::default(),
index 5b8a4adf25804cf2b7605b6ea22a5d7450a40c96..aafde574962d70252aadfcaf13909354bd4ca6ff 100644 (file)
@@ -13,7 +13,6 @@ use crate::{
   PostOrComment,
 };
 use activitypub_federation::{core::object_id::ObjectId, data::Data, traits::ActivityHandler};
-use activitystreams_kinds::public;
 use anyhow::anyhow;
 use lemmy_api_common::utils::blocking;
 use lemmy_db_schema::{
@@ -37,7 +36,6 @@ impl Vote {
     Ok(Vote {
       actor: ObjectId::new(actor.actor_id()),
       object: ObjectId::new(object.ap_id()),
-      cc: vec![public()],
       kind: kind.clone(),
       id: generate_activity_id(kind, &context.settings().get_protocol_and_hostname())?,
       unparsed: Default::default(),
index 6c43f48922fc64a3809591cbc5512a298dbf47e8..387f3d1060ed11fdf1d4fdaf91ed2ef8fd0ebb34 100644 (file)
@@ -2,7 +2,7 @@ use crate::{
   objects::person::ApubPerson,
   protocol::{activities::voting::vote::Vote, Unparsed},
 };
-use activitypub_federation::{core::object_id::ObjectId, deser::helpers::deserialize_one_or_many};
+use activitypub_federation::core::object_id::ObjectId;
 use activitystreams_kinds::activity::UndoType;
 use serde::{Deserialize, Serialize};
 use url::Url;
@@ -12,8 +12,6 @@ use url::Url;
 pub struct UndoVote {
   pub(crate) actor: ObjectId<ApubPerson>,
   pub(crate) object: Vote,
-  #[serde(deserialize_with = "deserialize_one_or_many", default)]
-  pub(crate) cc: Vec<Url>,
   #[serde(rename = "type")]
   pub(crate) kind: UndoType,
   pub(crate) id: Url,
index 8541b1369cec2115b9188b792d16c1005486a4d9..6d98862ec80279af5869c502b03e51aae6536a35 100644 (file)
@@ -3,7 +3,7 @@ use crate::{
   objects::person::ApubPerson,
   protocol::Unparsed,
 };
-use activitypub_federation::{core::object_id::ObjectId, deser::helpers::deserialize_one_or_many};
+use activitypub_federation::core::object_id::ObjectId;
 use lemmy_utils::error::LemmyError;
 use serde::{Deserialize, Serialize};
 use std::convert::TryFrom;
@@ -15,8 +15,6 @@ use url::Url;
 pub struct Vote {
   pub(crate) actor: ObjectId<ApubPerson>,
   pub(crate) object: ObjectId<PostOrComment>,
-  #[serde(deserialize_with = "deserialize_one_or_many", default)]
-  pub(crate) cc: Vec<Url>,
   #[serde(rename = "type")]
   pub(crate) kind: VoteType,
   pub(crate) id: Url,