aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-06-28 12:06:43 +0300
committerGravatar Vitaly Takmazov2018-06-28 12:06:43 +0300
commita4810340e53453e97106a998325af50243a7ab0d (patch)
treebdcd3babd551b91d086eea87c87c5afd68cb1cd4 /juick-server/src
parent0f0df74a6a0b069eabbf788d754389ee4c396f84 (diff)
api: do not return 404 for empty feeds
Diffstat (limited to 'juick-server/src')
-rw-r--r--juick-server/src/main/java/com/juick/server/api/Messages.java6
-rw-r--r--juick-server/src/main/java/com/juick/server/api/PM.java9
2 files changed, 4 insertions, 11 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 36d3e1dd..69cf828c 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
@@ -75,11 +75,7 @@ public class Messages {
if (!visitor.isAnonymous()) {
int vuid = visitor.getUid();
List<Integer> mids = messagesService.getMyFeed(vuid, before_mid, true);
-
- if (!mids.isEmpty())
- return ResponseEntity.ok(messagesService.getMessages(mids));
-
- return NOT_FOUND;
+ return ResponseEntity.ok(messagesService.getMessages(mids));
}
return FORBIDDEN;
}
diff --git a/juick-server/src/main/java/com/juick/server/api/PM.java b/juick-server/src/main/java/com/juick/server/api/PM.java
index 045d465e..cbd70bed 100644
--- a/juick-server/src/main/java/com/juick/server/api/PM.java
+++ b/juick-server/src/main/java/com/juick/server/api/PM.java
@@ -113,11 +113,8 @@ public class PM {
}
List<User> lastconv = pmQueriesService.getPMLastConversationsUsers(visitor.getUid(), cnt);
- if (lastconv != null && !lastconv.isEmpty()) {
- PrivateChats pms = new PrivateChats();
- pms.setUsers(lastconv);
- return pms;
- }
- throw new HttpNotFoundException();
+ PrivateChats pms = new PrivateChats();
+ pms.setUsers(lastconv);
+ return pms;
}
}