diff options
Diffstat (limited to 'src/java/com/juick/http/www/Main.java')
-rw-r--r-- | src/java/com/juick/http/www/Main.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/java/com/juick/http/www/Main.java b/src/java/com/juick/http/www/Main.java index 2c51456e..13506db7 100644 --- a/src/java/com/juick/http/www/Main.java +++ b/src/java/com/juick/http/www/Main.java @@ -41,7 +41,7 @@ import ru.sape.Sape; * @author Ugnich Anton */ @WebServlet(name = "Main", urlPatterns = {"/"}) -@MultipartConfig +@MultipartConfig(fileSizeThreshold = 1024 * 1024, maxRequestSize = 1024 * 1024 * 10) public class Main extends HttpServlet implements Stream.StreamListener { Connection sql; @@ -272,7 +272,19 @@ public class Main extends HttpServlet implements Stream.StreamListener { String uri = request.getRequestURI(); if (uri.equals("/post")) { - pagesNewMessage.doPostNewMessage(sql, request, response); + com.juick.User visitor = Utils.getVisitorUser(sql, request, response); + if (visitor != null) { + pagesNewMessage.doPostMessage(sql, request, response, xmpp, visitor); + } else { + response.sendError(403); + } + } else if (uri.equals("/comment")) { + com.juick.User visitor = Utils.getVisitorUser(sql, request, response); + if (visitor != null) { + pagesNewMessage.doPostComment(sql, request, response, xmpp, visitor); + } else { + response.sendError(403); + } } else if (uri.equals("/pm/send")) { com.juick.User visitor = Utils.getVisitorUser(sql, request, response); if (visitor != null) { |