diff options
Diffstat (limited to 'juick-www/src/main/java/com/juick')
-rw-r--r-- | juick-www/src/main/java/com/juick/www/controllers/Home.java | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/juick-www/src/main/java/com/juick/www/controllers/Home.java b/juick-www/src/main/java/com/juick/www/controllers/Home.java index 763d829e..a8a9f1bf 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/Home.java +++ b/juick-www/src/main/java/com/juick/www/controllers/Home.java @@ -17,13 +17,12 @@ package com.juick.www.controllers; import com.juick.server.util.HttpNotFoundException; +import com.juick.server.util.UserUtils; +import com.juick.server.util.WebUtils; import com.juick.service.MessagesService; import com.juick.service.TagService; import com.juick.service.UserService; -import com.juick.server.util.UserUtils; -import com.juick.server.util.WebUtils; import com.juick.www.Utils; -import com.juick.www.WebApp; import org.apache.commons.codec.CharEncoding; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; @@ -124,32 +123,24 @@ public class Home { } else if (paramShow.equals("top")) { return "redirect:/"; - } else if (paramShow.equals("my") && visitor != null) { + } else if (paramShow.equals("my") && !visitor.isAnonymous()) { title = "Моя лента"; mids = messagesService.getMyFeed(visitor.getUid(), paramBefore, true); - } else if (paramShow.equals("private") && visitor != null) { + } else if (paramShow.equals("private") && !visitor.isAnonymous()) { title = "Приватные"; mids = messagesService.getPrivate(visitor.getUid(), paramBefore); - } else if (paramShow.equals("discuss") && visitor != null) { + } else if (paramShow.equals("discuss") && !visitor.isAnonymous()) { title = "Обсуждения"; mids = messagesService.getDiscussions(visitor.getUid(), paramBefore); - } else if (paramShow.equals("recommended") && visitor != null) { + } else if (paramShow.equals("recommended") && !visitor.isAnonymous()) { title = "Рекомендации"; mids = messagesService.getRecommended(visitor.getUid(), paramBefore); } else if (paramShow.equals("photos")) { title = "Фотографии"; - if (visitor != null) { - mids = messagesService.getPhotos(visitor.getUid(), paramBefore); - } else { - mids = messagesService.getPhotos(0, paramBefore); - } + mids = messagesService.getPhotos(visitor.getUid(), paramBefore); } else if (paramShow.equals("all")) { title = "Все сообщения"; - if (visitor != null) { - mids = messagesService.getAll(visitor.getUid(), paramBefore); - } else { - mids = messagesService.getAll(0, paramBefore); - } + mids = messagesService.getAll(visitor.getUid(), paramBefore); } else { throw new HttpNotFoundException(); } |