diff options
author | Dessalines <tyhou13@gmx.com> | 2019-04-22 11:32:50 -0700 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2019-04-22 11:32:50 -0700 |
commit | bd3302317e222b4961dd0ccf8cd26ed858787929 (patch) | |
tree | 0e8f7230f69bcfbd5ef5d6a3faa1574c845539b2 /server | |
parent | 2e361aa7364b81a245115a298301a753a808b3fd (diff) |
Comment actions from inbox and user pages working.
- Fixes #93
Diffstat (limited to 'server')
-rw-r--r-- | server/src/websocket_server/server.rs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/server/src/websocket_server/server.rs b/server/src/websocket_server/server.rs index 068fd027..c61756e1 100644 --- a/server/src/websocket_server/server.rs +++ b/server/src/websocket_server/server.rs @@ -1311,14 +1311,17 @@ impl Perform for EditComment { return Err(self.error("Not allowed to edit comment."))? } - // Check for a community ban - if CommunityUserBanView::get(&conn, user_id, orig_comment.community_id).is_ok() { - return Err(self.error("You have been banned from this community"))? - } + // You are allowed to mark the comment as read even if you're banned. + if self.read.is_none() { + // Check for a community ban + if CommunityUserBanView::get(&conn, user_id, orig_comment.community_id).is_ok() { + return Err(self.error("You have been banned from this community"))? + } - // Check for a site ban - if UserView::read(&conn, user_id)?.banned { - return Err(self.error("You have been banned from the site"))? + // Check for a site ban + if UserView::read(&conn, user_id)?.banned { + return Err(self.error("You have been banned from the site"))? + } } let content_slurs_removed = remove_slurs(&self.content.to_owned()); |