summaryrefslogtreecommitdiff
path: root/include/tgbot/net/TgWebhookServer.h
diff options
context:
space:
mode:
authorOleg Morozenkov <omorozenkov@gmail.com>2015-08-12 13:43:02 +0300
committerOleg Morozenkov <omorozenkov@gmail.com>2015-08-12 13:43:02 +0300
commite3490d65bb824a9b4ee0fdc0872753fa295b1087 (patch)
tree0f61ecf6dd0e592c2390a8a93e3794dade2360f8 /include/tgbot/net/TgWebhookServer.h
parent7b3fa406eb228a00ef9f053bd2177d53b61b1d3d (diff)
Fix some compiler errors with global header file
Diffstat (limited to 'include/tgbot/net/TgWebhookServer.h')
-rw-r--r--include/tgbot/net/TgWebhookServer.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/include/tgbot/net/TgWebhookServer.h b/include/tgbot/net/TgWebhookServer.h
index f583093..d085331 100644
--- a/include/tgbot/net/TgWebhookServer.h
+++ b/include/tgbot/net/TgWebhookServer.h
@@ -34,19 +34,19 @@ 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 typename HttpServer<Protocol>::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)));
+ TgWebhookServer(std::shared_ptr<boost::asio::basic_socket_acceptor<Protocol>> acceptor, const std::string& path, const EventHandler* eventHandler) :
+ HttpServer<Protocol>(acceptor, [this, eventHandler, &path](const std::string& data, const std::map<std::string, std::string>& headers) -> std::string {
+ if (headers.at("method") == "POST" && headers.at("path") == path) {
+ eventHandler->handleUpdate(TgTypeParser::getInstance().parseJsonAndGetUpdate(TgTypeParser::getInstance().parseJson(data)));
}
- return HttpParser::generateResponse("");
+ return HttpParser::getInstance().generateResponse("");
})
{
}
- TgWebhookServer(std::shared_ptr<boost::asio::basic_socket_acceptor<Protocol>>& acceptor, const std::string& path, const Bot& bot) :
+ TgWebhookServer(std::shared_ptr<boost::asio::basic_socket_acceptor<Protocol>> acceptor, const std::string& path, const Bot& bot) :
TgWebhookServer(acceptor, path, &bot.getEventHandler())
{
}