From e3490d65bb824a9b4ee0fdc0872753fa295b1087 Mon Sep 17 00:00:00 2001 From: Oleg Morozenkov Date: Wed, 12 Aug 2015 13:43:02 +0300 Subject: Fix some compiler errors with global header file --- include/tgbot/net/TgWebhookServer.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'include/tgbot/net/TgWebhookServer.h') 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 class TgWebhookServer : public HttpServer { public: - TgWebhookServer(std::shared_ptr>& acceptor, const ServerHandler& handler) = delete; + TgWebhookServer(std::shared_ptr> acceptor, const typename HttpServer::ServerHandler& handler) = delete; - TgWebhookServer(std::shared_ptr>& acceptor, const std::string& path, const EventHandler* eventHandler) : - HttpServer(acceptor, [this, eventHandler, &path](const std::string& data, const std::map& headers) -> std::string { - if (headers["method"] == "POST" && headers["path"] == path) { - eventHandler->handleUpdate(TgTypeParser::getInstance().parseUpdate(TgTypeParser::getInstance().parseJson(data))); + TgWebhookServer(std::shared_ptr> acceptor, const std::string& path, const EventHandler* eventHandler) : + HttpServer(acceptor, [this, eventHandler, &path](const std::string& data, const std::map& 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>& acceptor, const std::string& path, const Bot& bot) : + TgWebhookServer(std::shared_ptr> acceptor, const std::string& path, const Bot& bot) : TgWebhookServer(acceptor, path, &bot.getEventHandler()) { } -- cgit v1.2.3