aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main/java/com/juick/www/Main.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-12-08 10:36:41 +0300
committerGravatar Vitaly Takmazov2016-12-08 15:24:32 +0300
commit70b1e26036175b78213b4350b0f9a504c6d7e9df (patch)
tree8fc9448977a8eb1e8fc5fab9647b1bc81fc204a3 /juick-www/src/main/java/com/juick/www/Main.java
parente4f1bdaf728e2189d1002a175fe744b80caf8dee (diff)
juick-www: /post2 from perl
Diffstat (limited to 'juick-www/src/main/java/com/juick/www/Main.java')
-rw-r--r--juick-www/src/main/java/com/juick/www/Main.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/juick-www/src/main/java/com/juick/www/Main.java b/juick-www/src/main/java/com/juick/www/Main.java
index 99d06fe6..27ecf3ec 100644
--- a/juick-www/src/main/java/com/juick/www/Main.java
+++ b/juick-www/src/main/java/com/juick/www/Main.java
@@ -64,6 +64,7 @@ public class Main extends HttpServlet {
User pagesUser = new User();
UserThread pagesUserThread = new UserThread();
NewMessage pagesNewMessage;
+ XMPPPost xmppPost = new XMPPPost();
FacebookLogin loginFacebook;
VKontakteLogin loginVK = new VKontakteLogin();
TwitterAuth twitterAuth;
@@ -377,6 +378,14 @@ public class Main extends HttpServlet {
response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}
break;
+ case "/post2":
+ com.juick.User visitor = Utils.getVisitorUser(sql, request, response);
+ if (visitor.getUid() > 0 && !visitor.isBanned()) {
+ xmppPost.doPostMessage(sql, request, response, xmpp, visitor);
+ } else {
+ response.sendError(HttpServletResponse.SC_FORBIDDEN);
+ }
+ break;
default:
response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
break;