aboutsummaryrefslogtreecommitdiff
path: root/src/java/com/juick/api/Messages.java
diff options
context:
space:
mode:
authorGravatar Ugnich Anton2014-08-05 04:49:24 +0700
committerGravatar Ugnich Anton2014-08-05 04:49:24 +0700
commit0742847f430b02d2d9031f1a11799ac7076e9e26 (patch)
tree5ac5bd1a2994d031557849563a1de095a5868006 /src/java/com/juick/api/Messages.java
parentb9de1e4cf886ee5b0fbd7025e2cf0fee6166d2ce (diff)
Messages.setPrivacy
Diffstat (limited to 'src/java/com/juick/api/Messages.java')
-rw-r--r--src/java/com/juick/api/Messages.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/java/com/juick/api/Messages.java b/src/java/com/juick/api/Messages.java
index b7d0891e..b5462258 100644
--- a/src/java/com/juick/api/Messages.java
+++ b/src/java/com/juick/api/Messages.java
@@ -41,6 +41,16 @@ public class Messages {
}
}
+ public void doSetPrivacy(HttpServletRequest request, HttpServletResponse response, Stream xmpp, int vuid) throws ServletException, IOException {
+ int mid = Utils.parseInt(request.getParameter("mid"), 0);
+ com.juick.User user = MessagesQueries.getMessageAuthor(sql, mid);
+ if (user != null && user.UID == vuid && MessagesQueries.setMessagePrivacy(sql, mid)) {
+ Main.replyJSON(request, response, "{\"status\":\"ok\"}");
+ } else {
+ response.sendError(400);
+ }
+ }
+
public void doSetPopular(HttpServletRequest request, HttpServletResponse response, Stream xmpp) throws ServletException, IOException {
int mid = Utils.parseInt(request.getParameter("mid"), 0);
int popular = Utils.parseInt(request.getParameter("popular"), 0);