]> Untitled Git - lemmy.git/commitdiff
Merge remote-tracking branch 'yerba/outbox-activities'
authorDessalines <tyhou13@gmx.com>
Fri, 29 Jan 2021 14:17:14 +0000 (09:17 -0500)
committerDessalines <tyhou13@gmx.com>
Fri, 29 Jan 2021 14:17:14 +0000 (09:17 -0500)
README.md
RELEASES.md
api_tests/package.json
api_tests/yarn.lock
crates/api/src/community.rs
crates/db_views_actor/src/community_view.rs
crates/db_views_moderator/src/mod_add_community_view.rs
crates/db_views_moderator/src/mod_add_view.rs
crates/db_views_moderator/src/mod_ban_from_community_view.rs
crates/db_views_moderator/src/mod_ban_view.rs
crates/structs/src/community.rs

index 3fbfe1139c6f687c69801525c39ed62eb0655cf9..33cbdf16c4c650efb0c808750a772056c4f4b4c1 100644 (file)
--- a/README.md
+++ b/README.md
@@ -67,7 +67,7 @@ Each Lemmy server can set its own moderation policy; appointing site-wide admins
 
 - Open source, [AGPL License](/LICENSE).
 - Self hostable, easy to deploy.
-  - Comes with [Docker](https://lemmy.ml/docs/en/administration_install_docker.html) and [Ansible](https://lemmy.ml/docs/en/administration_install_ansible.html).
+  - Comes with [Docker](https://lemmy.ml/docs/en/administration/install_docker.html) and [Ansible](https://lemmy.ml/docs/en/administration/install_ansible.html).
 - Clean, mobile-friendly interface.
   - Only a minimum of a username and password is required to sign up!
   - User avatar support.
@@ -102,8 +102,8 @@ Each Lemmy server can set its own moderation policy; appointing site-wide admins
 
 ## Installation
 
-- [Docker](https://lemmy.ml/docs/en/administration_install_docker.html)
-- [Ansible](https://lemmy.ml/docs/en/administration_install_ansible.html)
+- [Docker](https://lemmy.ml/docs/en/administration/install_docker.html)
+- [Ansible](https://lemmy.ml/docs/en/administration/install_ansible.html)
 
 ## Lemmy Projects
 
@@ -137,8 +137,8 @@ Lemmy is free, open-source software, meaning no advertising, monetizing, or vent
 ## Contributing
 
 - [Contributing instructions](https://lemmy.ml/docs/en/contributing.html)
-- [Docker Development](https://lemmy.ml/docs/en/contributing_docker_development.html)
-- [Local Development](https://lemmy.ml/docs/en/contributing_local_development.html)
+- [Docker Development](https://lemmy.ml/docs/en/contributing/docker_development.html)
+- [Local Development](https://lemmy.ml/docs/en/contributing/local_development.html)
 
 ### Translations
 
index fa5ad52fce5fba6d96964a2612f9aa937ec07db5..c881b95cbbf60cd5525361ff08b38ebd0fcc65bc 100644 (file)
@@ -21,6 +21,16 @@ We've also seen the first release of [Lemmur](https://github.com/krawieck/lemmur
 - Added query performance testing and comparisons. Added indexes to make sure every query is `< 30 ms`.
 - Added compilation time testing.
 
+### Federation
+
+This release includes some bug fixes for federation, and some changes to get us closer to compliance with the ActivityPub standard.
+
+- [Community bans now federating](https://github.com/LemmyNet/lemmy/issues/1287).
+- [Local posts sometimes got marked as remote](https://github.com/LemmyNet/lemmy/issues/1302).
+- [Creator of post/comment was not notified about new child comments](https://github.com/LemmyNet/lemmy/issues/1325).
+- [Community deletion now federated](https://github.com/LemmyNet/lemmy/issues/1256).
+
+None of these are breaking changes, so federation between 0.9.0 and 0.8.11 will work without problems.
 
 ### Lemmy javascript / typescript client
 
@@ -41,18 +51,6 @@ We've also seen the first release of [Lemmur](https://github.com/krawieck/lemmur
 - We moved documentation into a separate git repository, and support translation for the docs now!
 - Moved our code of conduct into the documentation.
 
-### Federation
-
-This release includes some bug fixes for federation, and some changes to get us closer to compliance with the ActivityPub standard.
-
-- fixed: [Community bans not federating](https://github.com/LemmyNet/lemmy/issues/1287)
-- fixed: [Local posts sometimes got marked as remote](https://github.com/LemmyNet/lemmy/issues/1302)
-- fixed: [Creator of post/comment is not notified about new child comments](https://github.com/LemmyNet/lemmy/issues/1325)
-- fixed: [Community deletion not federated](https://github.com/LemmyNet/lemmy/issues/1256)
-
-None of these are breaking changes, so federation between 0.9.0 and 0.8.11 will work without problems.
-
-
 ## Upgrading
 
 If you'd like to make a DB backup before upgrading, follow [this guide](https://lemmy.ml/docs/en/administration/backup_and_restore.html).
index 3e74a5accd06ad6083ea102679a922d206807bbc..e2c4f37a0e4000145e0bad2cdd9c357c66da3ea8 100644 (file)
@@ -16,7 +16,7 @@
     "eslint": "^7.18.0",
     "eslint-plugin-jane": "^9.0.3",
     "jest": "^26.6.3",
-    "lemmy-js-client": "0.9.0-rc.12",
+    "lemmy-js-client": "0.9.1-rc.1",
     "node-fetch": "^2.6.1",
     "prettier": "^2.1.2",
     "ts-jest": "^26.4.4",
index 8b7c8af50aa223472dc870b817ddeb0bcd087f77..8e29aa041725b9902bcf79a2646a1f4104e01631 100644 (file)
@@ -3233,10 +3233,10 @@ language-tags@^1.0.5:
   dependencies:
     language-subtag-registry "~0.3.2"
 
-lemmy-js-client@0.9.0-rc.12:
-  version "0.9.0-rc.12"
-  resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.9.0-rc.12.tgz#991d31c4ef89b9bd4088a17c60b6cbaac997df41"
-  integrity sha512-SeCw9wjU89Zm4YWhr+neHC2XvqoqzJg2e42sFEgcDmnQxpPt2sND9Udu+tjGXatbz0tCu6ybGmpR5M0QT4xx9Q==
+lemmy-js-client@0.9.1-rc.1:
+  version "0.9.1-rc.1"
+  resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.9.1-rc.1.tgz#afe3cb0d4852f849dd087a4756a3771bc920a907"
+  integrity sha512-aVvo4IeJvIPUvypipk4GnyLB6nVQVLfB0arYrMkVV4L7zrZ/0pGtpkMDLaOAj/KpA6O0u9eLmaou5RberZQolA==
 
 leven@^3.1.0:
   version "3.1.0"
index 48308f8d84be6ba768b5af15644bc592e31f96d9..26687b98bf932de3edfa9818d885141ed0525b1e 100644 (file)
@@ -21,6 +21,7 @@ use lemmy_db_queries::{
   Crud,
   Followable,
   Joinable,
+  ListingType,
   SortType,
 };
 use lemmy_db_schema::{
@@ -447,12 +448,14 @@ impl Perform for ListCommunities {
       None => false,
     };
 
+    let type_ = ListingType::from_str(&data.type_)?;
     let sort = SortType::from_str(&data.sort)?;
 
     let page = data.page;
     let limit = data.limit;
     let communities = blocking(context.pool(), move |conn| {
       CommunityQueryBuilder::create(conn)
+        .listing_type(&type_)
         .sort(&sort)
         .show_nsfw(show_nsfw)
         .my_user_id(user_id)
index 05dc37890b16644921b9d5f13f5b8708c21e2817..714fd65e8b3054ebaf3a9612949020c057c82998 100644 (file)
@@ -5,6 +5,7 @@ use lemmy_db_queries::{
   functions::hot_rank,
   fuzzy_search,
   limit_and_offset,
+  ListingType,
   MaybeOptional,
   SortType,
   ToSafe,
@@ -97,6 +98,7 @@ impl CommunityView {
 
 pub struct CommunityQueryBuilder<'a> {
   conn: &'a PgConnection,
+  listing_type: &'a ListingType,
   sort: &'a SortType,
   my_user_id: Option<i32>,
   show_nsfw: bool,
@@ -110,6 +112,7 @@ impl<'a> CommunityQueryBuilder<'a> {
     CommunityQueryBuilder {
       conn,
       my_user_id: None,
+      listing_type: &ListingType::All,
       sort: &SortType::Hot,
       show_nsfw: true,
       search_term: None,
@@ -118,6 +121,11 @@ impl<'a> CommunityQueryBuilder<'a> {
     }
   }
 
+  pub fn listing_type(mut self, listing_type: &'a ListingType) -> Self {
+    self.listing_type = listing_type;
+    self
+  }
+
   pub fn sort(mut self, sort: &'a SortType) -> Self {
     self.sort = sort;
     self
@@ -201,6 +209,12 @@ impl<'a> CommunityQueryBuilder<'a> {
       query = query.filter(community::nsfw.eq(false));
     };
 
+    query = match self.listing_type {
+      ListingType::Subscribed => query.filter(community_follower::user_id.is_not_null()), // TODO could be this: and(community_follower::user_id.eq(user_id_join)),
+      ListingType::Local => query.filter(community::local.eq(true)),
+      _ => query,
+    };
+
     let (limit, offset) = limit_and_offset(self.page, self.limit);
     let res = query
       .limit(limit)
index 1b31e02d4bb3f7c7e5b261292d15de623ac38b0f..dfb7de7e61adbf2c28fe607696541145415f4d83 100644 (file)
@@ -31,7 +31,7 @@ impl ModAddCommunityView {
     let mut query = mod_add_community::table
       .inner_join(user_::table.on(mod_add_community::mod_user_id.eq(user_::id)))
       .inner_join(community::table)
-      .inner_join(user_alias_1::table.on(mod_add_community::other_user_id.eq(user_::id)))
+      .inner_join(user_alias_1::table.on(mod_add_community::other_user_id.eq(user_alias_1::id)))
       .select((
         mod_add_community::all_columns,
         User_::safe_columns_tuple(),
index bc858728f0194b9a5737fe55cfa5b9d52b36b6e2..06c7091cc0e48ddc388a3df71d1d3c77f07adf58 100644 (file)
@@ -27,7 +27,7 @@ impl ModAddView {
   ) -> Result<Vec<Self>, Error> {
     let mut query = mod_add::table
       .inner_join(user_::table.on(mod_add::mod_user_id.eq(user_::id)))
-      .inner_join(user_alias_1::table.on(mod_add::other_user_id.eq(user_::id)))
+      .inner_join(user_alias_1::table.on(mod_add::other_user_id.eq(user_alias_1::id)))
       .select((
         mod_add::all_columns,
         User_::safe_columns_tuple(),
index 00ac452e700df72a82ef3f844ccc8c675b4107c3..1d9b1fafdd88f906acc483ac07ac769a178cf9b9 100644 (file)
@@ -31,7 +31,9 @@ impl ModBanFromCommunityView {
     let mut query = mod_ban_from_community::table
       .inner_join(user_::table.on(mod_ban_from_community::mod_user_id.eq(user_::id)))
       .inner_join(community::table)
-      .inner_join(user_alias_1::table.on(mod_ban_from_community::other_user_id.eq(user_::id)))
+      .inner_join(
+        user_alias_1::table.on(mod_ban_from_community::other_user_id.eq(user_alias_1::id)),
+      )
       .select((
         mod_ban_from_community::all_columns,
         User_::safe_columns_tuple(),
index 1a7743194881ef83b69034f56d5394d23d7d2122..ff599e18771108db3da312704823aad0729e61ef 100644 (file)
@@ -27,7 +27,7 @@ impl ModBanView {
   ) -> Result<Vec<Self>, Error> {
     let mut query = mod_ban::table
       .inner_join(user_::table.on(mod_ban::mod_user_id.eq(user_::id)))
-      .inner_join(user_alias_1::table.on(mod_ban::other_user_id.eq(user_::id)))
+      .inner_join(user_alias_1::table.on(mod_ban::other_user_id.eq(user_alias_1::id)))
       .select((
         mod_ban::all_columns,
         User_::safe_columns_tuple(),
index 5cf3d36d95ee8752ec290d9a04b97b1fc0107d98..fbbf2e4035d1aa522138e9ecf2b75becd345267e 100644 (file)
@@ -39,6 +39,7 @@ pub struct CommunityResponse {
 
 #[derive(Deserialize, Debug)]
 pub struct ListCommunities {
+  pub type_: String,
   pub sort: String,
   pub page: Option<i64>,
   pub limit: Option<i64>,