aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/www/api/Messages.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2021-04-17 08:39:21 +0300
committerGravatar Vitaly Takmazov2021-04-17 08:39:21 +0300
commit7203299e6ec544d36f4889e02b946bb9b6061f09 (patch)
treec816307ba3c0b48475fdb32b93ceb91d862c924b /src/main/java/com/juick/www/api/Messages.java
parent7412ab820803908297db14ec8f9c8e9e1d339003 (diff)
Cleanup deprecated usage of third-party libraries
Diffstat (limited to 'src/main/java/com/juick/www/api/Messages.java')
-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);