diff options
author | Vitaly Takmazov | 2018-08-03 12:38:18 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-08-03 12:38:18 +0300 |
commit | 162262eb58c4642b7ffb9ed41bc760e0f009d6a6 (patch) | |
tree | b72b3b1807c561c61c3c40c27f07ba3e012acd73 /juick-server/src/main/java/com/juick/server | |
parent | 798e8da8737c4fe5fee8dfaa7f98bfa13e2d91da (diff) |
replies counter in feeds reflect banned comments
Diffstat (limited to 'juick-server/src/main/java/com/juick/server')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/api/Messages.java | 6 | ||||
-rw-r--r-- | juick-server/src/main/java/com/juick/server/api/rss/Feeds.java | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/juick-server/src/main/java/com/juick/server/api/Messages.java b/juick-server/src/main/java/com/juick/server/api/Messages.java index eb562103..d7c07391 100644 --- a/juick-server/src/main/java/com/juick/server/api/Messages.java +++ b/juick-server/src/main/java/com/juick/server/api/Messages.java @@ -76,7 +76,7 @@ public class Messages { if (!visitor.isAnonymous()) { int vuid = visitor.getUid(); List<Integer> mids = messagesService.getMyFeed(vuid, before_mid, true); - return ResponseEntity.ok(messagesService.getMessages(mids)); + return ResponseEntity.ok(messagesService.getMessages(visitor, mids)); } return FORBIDDEN; } @@ -138,7 +138,7 @@ public class Messages { mids = messagesService.getAll(visitor.getUid(), before); } } - return ResponseEntity.ok(messagesService.getMessages(mids)); + return ResponseEntity.ok(messagesService.getMessages(visitor, mids)); } @DeleteMapping("/messages") public CommandResult deleteMessage(@RequestParam int mid, @RequestParam(required = false, defaultValue = "0") int rid) { @@ -156,7 +156,7 @@ public class Messages { @GetMapping("/messages/discussions") public List<Message> getDiscussions( @RequestParam(required = false, defaultValue = "0") Long to) { - return messagesService.getMessages(messagesService.getDiscussions(UserUtils.getCurrentUser().getUid(), to)); + return messagesService.getMessages(UserUtils.getCurrentUser(), messagesService.getDiscussions(UserUtils.getCurrentUser().getUid(), to)); } @GetMapping("/thread") public ResponseEntity<List<com.juick.Message>> getThread( diff --git a/juick-server/src/main/java/com/juick/server/api/rss/Feeds.java b/juick-server/src/main/java/com/juick/server/api/rss/Feeds.java index d2d112d8..ebf5b04e 100644 --- a/juick-server/src/main/java/com/juick/server/api/rss/Feeds.java +++ b/juick-server/src/main/java/com/juick/server/api/rss/Feeds.java @@ -19,6 +19,7 @@ package com.juick.server.api.rss; import com.juick.User; import com.juick.server.util.HttpBadRequestException; +import com.juick.server.util.UserUtils; import com.juick.service.MessagesService; import com.juick.service.UserService; import org.springframework.stereotype.Controller; @@ -50,7 +51,7 @@ public class Feeds { ModelAndView modelAndView = new ModelAndView(); modelAndView.setViewName("messagesView"); modelAndView.addObject("user", user); - modelAndView.addObject("messages", messagesService.getMessages(mids)); + modelAndView.addObject("messages", messagesService.getMessages(UserUtils.getCurrentUser(), mids)); return modelAndView; } throw new HttpBadRequestException(); @@ -61,7 +62,7 @@ public class Feeds { List<Integer> mids = messagesService.getLastMessages(hours); ModelAndView modelAndView = new ModelAndView(); modelAndView.setViewName("messagesView"); - modelAndView.addObject("messages", messagesService.getMessages(mids)); + modelAndView.addObject("messages", messagesService.getMessages(UserUtils.getCurrentUser(),mids)); return modelAndView; } @RequestMapping(value = "/rss/comments", method = RequestMethod.GET) |