aboutsummaryrefslogtreecommitdiff
path: root/juick-api/src/main/java/com/juick/api/Messages.java
diff options
context:
space:
mode:
Diffstat (limited to 'juick-api/src/main/java/com/juick/api/Messages.java')
-rw-r--r--juick-api/src/main/java/com/juick/api/Messages.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/juick-api/src/main/java/com/juick/api/Messages.java b/juick-api/src/main/java/com/juick/api/Messages.java
index 93abb06b..024a79c1 100644
--- a/juick-api/src/main/java/com/juick/api/Messages.java
+++ b/juick-api/src/main/java/com/juick/api/Messages.java
@@ -76,13 +76,13 @@ public class Messages {
if (tagObject != null) {
mids = MessagesQueries.getUserTag(sql, user.getUid(), tagObject.TID, 0, before_mid);
} else {
- response.sendError(404);
+ response.sendError(HttpServletResponse.SC_NOT_FOUND);
}
} else {
mids = MessagesQueries.getUserBlog(sql, user.getUid(), 0, before_mid);
}
} else {
- response.sendError(404);
+ response.sendError(HttpServletResponse.SC_NOT_FOUND);
}
} else {
if (!StringUtils.isEmpty(popular)) {
@@ -94,7 +94,7 @@ public class Messages {
if (tagObject != null) {
mids = MessagesQueries.getTag(sql, tagObject.TID, vuid, before_mid, 20);
} else {
- response.sendError(404);
+ response.sendError(HttpServletResponse.SC_NOT_FOUND);
}
} else {
mids = MessagesQueries.getAll(sql, vuid, before_mid);
@@ -108,14 +108,14 @@ public class Messages {
com.juick.Message msg = MessagesQueries.getMessage(sql, mid);
if (msg != null) {
if (!MessagesQueries.canViewThread(sql, mid, vuid)) {
- response.sendError(403);
+ response.sendError(HttpServletResponse.SC_FORBIDDEN);
} else {
List<com.juick.Message> replies = MessagesQueries.getReplies(sql, mid);
replies.add(0, msg);
feedMessages(request, response, replies);
}
} else {
- response.sendError(404);
+ response.sendError(HttpServletResponse.SC_NOT_FOUND);
}
}
@@ -131,10 +131,10 @@ public class Messages {
String json = messageSerializer.serializeList(msgs);
Main.replyJSON(request, response, json);
} else {
- response.sendError(404);
+ response.sendError(HttpServletResponse.SC_NOT_FOUND);
}
} else {
- response.sendError(404);
+ response.sendError(HttpServletResponse.SC_NOT_FOUND);
}
}
@@ -146,7 +146,7 @@ public class Messages {
if (user != null && user.getUid() == vuid && MessagesQueries.setMessagePrivacy(sql, mid)) {
Main.replyJSON(request, response, "{\"status\":\"ok\"}");
} else {
- response.sendError(400);
+ response.sendError(HttpServletResponse.SC_BAD_REQUEST);
}
}