diff options
author | Ugnich Anton | 2014-01-27 05:20:28 +0700 |
---|---|---|
committer | Ugnich Anton | 2014-01-27 05:20:28 +0700 |
commit | a5b5fe42c3ccef860ac56527dfcb79a3a0ecbfa4 (patch) | |
tree | cb0f460882838c28e47c7345c048fcb329097056 /src/java/com/juick/http/www/Main.java | |
parent | d2ef58b690344e8543771a9d870d85d10249fedf (diff) |
postPM
Diffstat (limited to 'src/java/com/juick/http/www/Main.java')
-rw-r--r-- | src/java/com/juick/http/www/Main.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/java/com/juick/http/www/Main.java b/src/java/com/juick/http/www/Main.java index fa4f9850..7564664a 100644 --- a/src/java/com/juick/http/www/Main.java +++ b/src/java/com/juick/http/www/Main.java @@ -28,6 +28,7 @@ import java.sql.DriverManager; import java.sql.SQLException; import java.util.Properties; import javax.servlet.ServletException; +import javax.servlet.annotation.MultipartConfig; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; @@ -39,6 +40,7 @@ import ru.sape.Sape; * @author Ugnich Anton */ @WebServlet(name = "Main", urlPatterns = {"/"}) +@MultipartConfig public class Main extends HttpServlet implements Stream.StreamListener { Connection sql; @@ -270,6 +272,12 @@ public class Main extends HttpServlet implements Stream.StreamListener { if (uri.equals("/post")) { pagesNewMessage.doPostNewMessage(sql, request, response); } else if (uri.equals("/pm/send")) { + com.juick.User visitor = Utils.getVisitorUser(sql, request, response); + if (visitor != null) { + pm.doPostPM(sql, request, response, xmpp, visitor); + } else { + response.sendError(403); + } } else if (uri.equals("/login")) { login.doPostLogin(sql, request, response); } else if (uri.equals("/signup")) { |