aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/api/Main.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/api/Main.java')
-rw-r--r--src/main/java/com/juick/api/Main.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/main/java/com/juick/api/Main.java b/src/main/java/com/juick/api/Main.java
index c43804d7..003b9aa3 100644
--- a/src/main/java/com/juick/api/Main.java
+++ b/src/main/java/com/juick/api/Main.java
@@ -19,7 +19,10 @@ package com.juick.api;
import com.juick.Tag;
import com.juick.json.MessageSerializer;
-import com.juick.server.*;
+import com.juick.server.MessagesQueries;
+import com.juick.server.SubscriptionsQueries;
+import com.juick.server.TagQueries;
+import com.juick.server.UserQueries;
import com.juick.xmpp.JID;
import com.juick.xmpp.Message;
import com.juick.xmpp.Stream;
@@ -40,8 +43,6 @@ import java.io.IOException;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.URL;
-import java.net.URLEncoder;
-import java.sql.Connection;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
@@ -63,6 +64,7 @@ public class Main extends HttpServlet implements Stream.StreamListener {
Users users;
PM pm;
Others others;
+ TelegramBotHook tgb;
@Override
public void init() throws ServletException {
@@ -79,7 +81,7 @@ public class Main extends HttpServlet implements Stream.StreamListener {
users = new Users(jdbc);
pm = new PM(jdbc);
others = new Others(jdbc);
-
+ tgb = new TelegramBotHook(conf.getProperty("telegram_token", ""));
setupXmppComponent(conf.getProperty("xmpp_host", "localhost"), Integer.parseInt(conf.getProperty("xmpp_port", "5347")),
conf.getProperty("xmpp_jid", "api.localhost"), conf.getProperty("xmpp_password"));
@@ -209,6 +211,9 @@ public class Main extends HttpServlet implements Stream.StreamListener {
case "/pm":
pm.doPostPM(request, response, xmpp, vuid);
break;
+ case "/tlgmbtwbhk":
+ tgb.doPost(request, response);
+ break;
default:
response.sendError(405);
break;