diff options
author | Oleg Morozenkov <m@oleg.rocks> | 2018-07-23 01:56:42 +0300 |
---|---|---|
committer | Oleg Morozenkov <m@oleg.rocks> | 2018-07-23 01:56:42 +0300 |
commit | d47ee877be5d1175bdc36f2d87881ddaf875a8e9 (patch) | |
tree | 7fd20cdc1236fe6b832ae980de12afd7071ebab9 /src/net/TgLongPoll.cpp | |
parent | cea20d4078f2088dea0dd589f1cc9dd7ee22461b (diff) |
Refactor http clients, fix webhook server, add more samples, change tabs to 4 spaces
Diffstat (limited to 'src/net/TgLongPoll.cpp')
-rw-r--r-- | src/net/TgLongPoll.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/net/TgLongPoll.cpp b/src/net/TgLongPoll.cpp index 30ce815..6af8a62 100644 --- a/src/net/TgLongPoll.cpp +++ b/src/net/TgLongPoll.cpp @@ -25,21 +25,21 @@ namespace TgBot { TgLongPoll::TgLongPoll(const Api* api, const EventHandler* eventHandler, int32_t limit, int32_t timeout, const std::shared_ptr<std::vector<std::string>>& allowupdates) - : _api(api), _eventHandler(eventHandler), _limit(limit), _timeout(timeout), _allowupdates(allowupdates) { + : _api(api), _eventHandler(eventHandler), _limit(limit), _timeout(timeout), _allowupdates(allowupdates) { } TgLongPoll::TgLongPoll(const Bot& bot, int32_t limit, int32_t timeout, const std::shared_ptr<std::vector<std::string>>& allowupdates) : - TgLongPoll(&bot.getApi(), &bot.getEventHandler(), limit, timeout, allowupdates) { + TgLongPoll(&bot.getApi(), &bot.getEventHandler(), limit, timeout, allowupdates) { } void TgLongPoll::start() { - std::vector<Update::Ptr> updates = _api->getUpdates(_lastUpdateId, _limit, _timeout, _allowupdates); - for (Update::Ptr& item : updates) { - if (item->updateId >= _lastUpdateId) { - _lastUpdateId = item->updateId + 1; - } - _eventHandler->handleUpdate(item); - } + std::vector<Update::Ptr> updates = _api->getUpdates(_lastUpdateId, _limit, _timeout, _allowupdates); + for (Update::Ptr& item : updates) { + if (item->updateId >= _lastUpdateId) { + _lastUpdateId = item->updateId + 1; + } + _eventHandler->handleUpdate(item); + } } } |