summaryrefslogtreecommitdiff
path: root/include/tgbot/net/TgWebhookServer.h
diff options
context:
space:
mode:
authorOleg Morozenkov <omorozenkov@gmail.com>2015-08-11 22:13:23 +0300
committerOleg Morozenkov <omorozenkov@gmail.com>2015-08-11 22:13:23 +0300
commit376b88ec09ef8cf71dd823467406c58204485fcc (patch)
tree9ca599b854d18006c65b26003ce7dbdd416fdf18 /include/tgbot/net/TgWebhookServer.h
parentd7fbf7149d0e0c1c30972dab68d510ef6ac377dd (diff)
Fixed compiler's errors in TgTypeParser + fixed indentation + some other fixes
Diffstat (limited to 'include/tgbot/net/TgWebhookServer.h')
-rw-r--r--include/tgbot/net/TgWebhookServer.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/include/tgbot/net/TgWebhookServer.h b/include/tgbot/net/TgWebhookServer.h
index a8155ff..f583093 100644
--- a/include/tgbot/net/TgWebhookServer.h
+++ b/include/tgbot/net/TgWebhookServer.h
@@ -34,22 +34,22 @@ template<typename Protocol>
class TgWebhookServer : public HttpServer<Protocol> {
public:
- TgWebhookServer(std::shared_ptr<boost::asio::basic_socket_acceptor<Protocol>>& acceptor, const ServerHandler& handler) = delete;
-
- TgWebhookServer(std::shared_ptr<boost::asio::basic_socket_acceptor<Protocol>>& acceptor, const std::string& path, const EventHandler* eventHandler) :
- HttpServer(acceptor, [this, eventHandler, &path](const std::string& data, const std::map<std::string, std::string>& headers) -> std::string {
- if (headers["method"] == "POST" && headers["path"] == path) {
- eventHandler->handleUpdate(TgTypeParser::getInstance().parseUpdate(TgTypeParser::getInstance().parseJson(data)));
- }
- return HttpParser::generateResponse("");
- })
- {
- }
-
- TgWebhookServer(std::shared_ptr<boost::asio::basic_socket_acceptor<Protocol>>& acceptor, const std::string& path, const Bot& bot) :
- TgWebhookServer(acceptor, path, &bot.getEventHandler())
- {
- }
+ TgWebhookServer(std::shared_ptr<boost::asio::basic_socket_acceptor<Protocol>>& acceptor, const ServerHandler& handler) = delete;
+
+ TgWebhookServer(std::shared_ptr<boost::asio::basic_socket_acceptor<Protocol>>& acceptor, const std::string& path, const EventHandler* eventHandler) :
+ HttpServer(acceptor, [this, eventHandler, &path](const std::string& data, const std::map<std::string, std::string>& headers) -> std::string {
+ if (headers["method"] == "POST" && headers["path"] == path) {
+ eventHandler->handleUpdate(TgTypeParser::getInstance().parseUpdate(TgTypeParser::getInstance().parseJson(data)));
+ }
+ return HttpParser::generateResponse("");
+ })
+ {
+ }
+
+ TgWebhookServer(std::shared_ptr<boost::asio::basic_socket_acceptor<Protocol>>& acceptor, const std::string& path, const Bot& bot) :
+ TgWebhookServer(acceptor, path, &bot.getEventHandler())
+ {
+ }
};
}