aboutsummaryrefslogtreecommitdiff
path: root/src/java/com/juick/http/www/Main.java
diff options
context:
space:
mode:
authorGravatar Ugnich Anton2014-04-17 15:40:27 +0700
committerGravatar Ugnich Anton2014-04-17 15:40:27 +0700
commit29a8f0ae0fdc27a03b723c7a9ad3be7f35db7b23 (patch)
tree400e8b4924b979cab2fe1f44641cd32eb02d62d2 /src/java/com/juick/http/www/Main.java
parent52e058a98e496a4e5a2372420d9dd8308881c384 (diff)
NewMessage complete rewrite
Diffstat (limited to 'src/java/com/juick/http/www/Main.java')
-rw-r--r--src/java/com/juick/http/www/Main.java16
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) {