diff --git a/ansible/templates/env b/ansible/templates/env
index 8b45ef77..22e9beda 100644
--- a/ansible/templates/env
+++ b/ansible/templates/env
@@ -6,7 +6,7 @@ RATE_LIMIT_MESSAGE=30
RATE_LIMIT_MESSAGE_PER_SECOND=60
RATE_LIMIT_POST=3
RATE_LIMIT_POST_PER_SECOND=600
-RATE_LIMIT_REGISTER=1
+RATE_LIMIT_REGISTER=3
RATE_LIMIT_REGISTER_PER_SECOND=3600
SMTP_SERVER={{ smtp_server }}
SMTP_LOGIN={{ smtp_login }}
diff --git a/docker/dev/.env b/docker/dev/.env
index fb43451d..014ce5c3 100644
--- a/docker/dev/.env
+++ b/docker/dev/.env
@@ -7,7 +7,7 @@ RATE_LIMIT_MESSAGE=30
RATE_LIMIT_MESSAGE_PER_SECOND=60
RATE_LIMIT_POST=6
RATE_LIMIT_POST_PER_SECOND=600
-RATE_LIMIT_REGISTER=1
+RATE_LIMIT_REGISTER=3
RATE_LIMIT_REGISTER_PER_SECOND=3600
# Optional email fields
diff --git a/docker/prod/.env b/docker/prod/.env
index fb43451d..014ce5c3 100644
--- a/docker/prod/.env
+++ b/docker/prod/.env
@@ -7,7 +7,7 @@ RATE_LIMIT_MESSAGE=30
RATE_LIMIT_MESSAGE_PER_SECOND=60
RATE_LIMIT_POST=6
RATE_LIMIT_POST_PER_SECOND=600
-RATE_LIMIT_REGISTER=1
+RATE_LIMIT_REGISTER=3
RATE_LIMIT_REGISTER_PER_SECOND=3600
# Optional email fields
diff --git a/docs/api.md b/docs/api.md
index f31fb60d..16383d53 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -1,11 +1,11 @@
-# Lemmy WebSocket API
+# Lemmy API
*Note: this may lag behind the actual API endpoints [here](../server/src/api).*
- [Data types](#data-types)
- [Basic usage](#basic-usage)
- * [Endpoint](#endpoint)
+ * [WebSocket Endpoint](#websocket-endpoint)
* [Testing with Websocat](#testing-with-websocat)
* [Testing with the WebSocket JavaScript API](#testing-with-the-websocket-javascript-api)
- [Rate limits](#rate-limits)
@@ -125,6 +125,10 @@
+ [Create Comment Like](#create-comment-like)
- [Request](#request-35)
- [Response](#response-35)
+ * [RSS / Atom feeds](#rss--atom-feeds)
+ + [All](#all)
+ + [Community](#community-1)
+ + [User](#user)
@@ -140,7 +144,7 @@
Request and response strings are in [JSON format](https://www.json.org).
-### Endpoint
+### WebSocket Endpoint
Connect to ws://***host***/api/v1/ws
to get started.
@@ -1010,3 +1014,18 @@ Mods and admins can remove a comment, creators can delete it.
comment: CommentView
}
```
+
+### RSS / Atom feeds
+
+#### All
+
+`/feeds/all.xml?sort=Hot`
+
+#### Community
+
+`/feeds/c/community-name.xml?sort=Hot`
+
+#### User
+
+`/feeds/u/user-name.xml?sort=Hot`
+
diff --git a/server/src/db/post_view.rs b/server/src/db/post_view.rs
index 23454b6e..cd807847 100644
--- a/server/src/db/post_view.rs
+++ b/server/src/db/post_view.rs
@@ -79,6 +79,7 @@ pub struct PostViewQuery<'a> {
conn: &'a PgConnection,
query: BoxedQuery<'a, Pg>,
my_user_id: Option,
+ for_creator_id: Option,
page: Option,
limit: Option,
}
@@ -142,6 +143,7 @@ impl<'a> PostViewQuery<'a> {
conn,
query,
my_user_id: None,
+ for_creator_id: None,
page: None,
limit: None,
}
@@ -162,8 +164,7 @@ impl<'a> PostViewQuery<'a> {
}
pub fn for_creator_id(mut self, for_creator_id: i32) -> Self {
- use super::post_view::post_view::dsl::*;
- self.query = self.query.filter(creator_id.eq(for_creator_id));
+ self.for_creator_id = Some(for_creator_id);
self
}
@@ -239,6 +240,17 @@ impl<'a> PostViewQuery<'a> {
self.query.filter(user_id.is_null())
};
+ // If its for a specific user, show the removed / deleted
+ if let Some(for_creator_id) = self.for_creator_id {
+ self.query = self.query.filter(creator_id.eq(for_creator_id));
+ } else {
+ self.query = self.query
+ .filter(removed.eq(false))
+ .filter(deleted.eq(false))
+ .filter(community_removed.eq(false))
+ .filter(community_deleted.eq(false));
+ }
+
let (limit, offset) = limit_and_offset(self.page, self.limit);
let query = self
.query