diff options
author | 2018-02-20 16:33:00 +0300 | |
---|---|---|
committer | 2018-02-20 16:33:00 +0300 | |
commit | 99619c5d4e5e45dd8e1dc92b1de043afc1243cb6 (patch) | |
tree | f1c9648d21a9798ffda091e7f23d08911f0505a9 /juick-www/src/main/java/com/juick/www/controllers/Messages.java | |
parent | 7b008a32def3c1202734b5e82f6887053071066a (diff) |
www: sape links in tag again
Diffstat (limited to 'juick-www/src/main/java/com/juick/www/controllers/Messages.java')
-rw-r--r-- | juick-www/src/main/java/com/juick/www/controllers/Messages.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/juick-www/src/main/java/com/juick/www/controllers/Messages.java b/juick-www/src/main/java/com/juick/www/controllers/Messages.java index 3775a702..3c938850 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/Messages.java +++ b/juick-www/src/main/java/com/juick/www/controllers/Messages.java @@ -393,6 +393,7 @@ public class Messages { @GetMapping("/tag/{tagName}") protected String tagAction(HttpServletRequest request, @PathVariable String tagName, + @CookieValue(name = "sape_cookie", required = false, defaultValue = StringUtils.EMPTY) String sapeCookie, @RequestParam(required = false, defaultValue = "0") int before, ModelMap model) throws IOException { com.juick.User visitor = UserUtils.getCurrentUser(); @@ -451,6 +452,13 @@ public class Messages { String nextpage = "/tag/" + URLEncoder.encode(paramTag.getName(), CharEncoding.UTF_8) + "?before=" + mids.get(mids.size() - 1); model.addAttribute("nextpage", nextpage); } + UriComponents builder = ServletUriComponentsBuilder.fromCurrentRequestUri().build(); + String queryString = builder.getQuery(); + String requestURI = builder.toUri().getPath(); + if (sape != null && visitor.getUid() == 0 && queryString == null) { + String links = sape.getPageLinks(requestURI, sapeCookie).render(); + model.addAttribute("links", links); + } return "views/index"; } @GetMapping("/pm/inbox") |