aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/www/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/www/api')
-rw-r--r--src/main/java/com/juick/www/api/Messages.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/main/java/com/juick/www/api/Messages.java b/src/main/java/com/juick/www/api/Messages.java
index b7e9cb0b..395d00d8 100644
--- a/src/main/java/com/juick/www/api/Messages.java
+++ b/src/main/java/com/juick/www/api/Messages.java
@@ -102,23 +102,23 @@ public class Messages {
@RequestParam(required = false) String media,
@RequestParam(required = false) String tag) {
List<Integer> mids;
- if (!StringUtils.isEmpty(uname)) {
+ if (StringUtils.hasText(uname)) {
User user = userService.getUserByName(uname);
if (!user.isAnonymous() && !user.isBanned()) {
- if (!StringUtils.isEmpty(media)) {
+ if (StringUtils.hasText(media)) {
mids = messagesService.getUserPhotos(user.getUid(), 0, before);
- } else if (!StringUtils.isEmpty(tag)) {
+ } else if (StringUtils.hasText(tag)) {
Tag tagObject = tagService.getTag(tag, false);
if (tagObject != null) {
mids = messagesService.getUserTag(user.getUid(), tagObject.TID, 0, before);
} else {
return NOT_FOUND;
}
- } else if (!StringUtils.isEmpty(withrecommended)) {
+ } else if (StringUtils.hasText(withrecommended)) {
mids = messagesService.getUserBlogWithRecommendations(user.getUid(), 0, before);
} else if (daysback > 0) {
mids = messagesService.getUserBlogAtDay(user.getUid(), 0, daysback);
- } else if (!StringUtils.isEmpty(search)) {
+ } else if (StringUtils.hasText(search)) {
mids = messagesService.getUserSearch(visitor, user.getUid(), WebUtils.encodeSphinx(search), 0, page);
} else {
mids = messagesService.getUserBlog(user.getUid(), 0, before);
@@ -127,18 +127,18 @@ public class Messages {
return NOT_FOUND;
}
} else {
- if (!StringUtils.isEmpty(popular)) {
+ if (StringUtils.hasText(popular)) {
mids = messagesService.getPopular(visitor.getUid(), before);
- } else if (!StringUtils.isEmpty(media)) {
+ } else if (StringUtils.hasText(media)) {
mids = messagesService.getPhotos(visitor.getUid(), before);
- } else if (!StringUtils.isEmpty(tag)) {
+ } else if (StringUtils.hasText(tag)) {
Tag tagObject = tagService.getTag(tag, false);
if (tagObject != null) {
mids = messagesService.getTag(tagObject.TID, visitor.getUid(), before, 20);
} else {
return NOT_FOUND;
}
- } else if (!StringUtils.isEmpty(search)) {
+ } else if (StringUtils.hasText(search)) {
mids = messagesService.getSearch(visitor, WebUtils.encodeSphinx(search), page);
} else {
mids = messagesService.getAll(visitor.getUid(), before);