From: Felix Date: Thu, 12 Mar 2020 02:35:32 +0000 (+0100) Subject: Federate follower count, use string id for community X-Git-Url: http://these/git/%22https:/nerdica.net/%7B%24%7B%60data:application/static/%24%7B%60data:application/%7Bthis.imageSrc.unwrap%28%29%7D?a=commitdiff_plain;h=27c07f1f84d02bf8baa2bceb1d8a0effac67a6c9;p=lemmy.git Federate follower count, use string id for community --- diff --git a/docker/federation-test/docker-compose.yml b/docker/federation-test/docker-compose.yml index 39079d10..464d7081 100644 --- a/docker/federation-test/docker-compose.yml +++ b/docker/federation-test/docker-compose.yml @@ -6,7 +6,7 @@ services: ports: - "127.0.0.1:8540:8540" environment: - - LEMMY_HOSTNAME=localhost:8540 + - LEMMY_HOSTNAME=lemmy_alpha:8540 - LEMMY_DATABASE_URL=postgres://lemmy:password@postgres_alpha:5432/lemmy - LEMMY_JWT_SECRET=changeme - LEMMY_FRONT_END_DIR=/app/dist @@ -32,7 +32,7 @@ services: ports: - "127.0.0.1:8541:8541" environment: - - LEMMY_HOSTNAME=localhost:8541 + - LEMMY_HOSTNAME=lemmy_beta:8541 - LEMMY_DATABASE_URL=postgres://lemmy:password@postgres_beta:5432/lemmy - LEMMY_JWT_SECRET=changeme - LEMMY_FRONT_END_DIR=/app/dist diff --git a/server/src/apub/community.rs b/server/src/apub/community.rs index bbb9da6e..b5b365d0 100644 --- a/server/src/apub/community.rs +++ b/server/src/apub/community.rs @@ -15,7 +15,7 @@ use serde::Deserialize; impl Community { pub fn as_group(&self) -> Result { - let base_url = make_apub_endpoint("c", &self.id); + let base_url = make_apub_endpoint("c", &self.name); let mut group = Group::default(); let oprops: &mut ObjectProperties = group.as_mut(); diff --git a/server/src/apub/puller.rs b/server/src/apub/puller.rs index 1465415b..aa34ce50 100644 --- a/server/src/apub/puller.rs +++ b/server/src/apub/puller.rs @@ -2,10 +2,10 @@ extern crate reqwest; use crate::api::community::{GetCommunityResponse, ListCommunitiesResponse}; use crate::api::post::GetPosts; -use crate::apub::parse_apub_endpoint; use crate::db::community_view::CommunityView; use crate::settings::Settings; use activitystreams::actor::apub::Group; +use activitystreams::collection::apub::UnorderedCollection; use failure::Error; // TODO: right now all of the data is requested on demand, for production we will need to store @@ -38,6 +38,12 @@ pub fn get_remote_community(identifier: String) -> Result Result()?, + id: -1, //community.object_props.get_id() name, title: community .object_props @@ -60,15 +64,7 @@ pub fn get_remote_community(identifier: String) -> Result()?, + creator_id: -1, //community.object_props.get_attributed_to_xsd_any_uri() removed: false, published: community .object_props @@ -86,7 +82,11 @@ pub fn get_remote_community(identifier: String) -> Result