summaryrefslogtreecommitdiff
path: root/src/net/TgLongPoll.cpp
diff options
context:
space:
mode:
authorEgor Pugin <egor.pugin@gmail.com>2020-03-14 17:34:07 +0300
committerGitHub <noreply@github.com>2020-03-14 17:34:07 +0300
commitb3e84e58d471412b9d26e173b77c757d93d57b19 (patch)
tree5ad991beda3975e8d8237562724e20f30d169d40 /src/net/TgLongPoll.cpp
parent9afa9c4e97faa9a6d7e6089ec1f822047738fdec (diff)
parent64174491dac84c559db5c48ed850177fa3eb4da0 (diff)
Merge pull request #133 from JellyBrick/master
Fix #127, #128 & Code quality improvements
Diffstat (limited to 'src/net/TgLongPoll.cpp')
-rw-r--r--src/net/TgLongPoll.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/net/TgLongPoll.cpp b/src/net/TgLongPoll.cpp
index 0138620..6d266f8 100644
--- a/src/net/TgLongPoll.cpp
+++ b/src/net/TgLongPoll.cpp
@@ -1,19 +1,21 @@
#include "tgbot/net/TgLongPoll.h"
#include <cstdint>
+#include <utility>
namespace TgBot {
-TgLongPoll::TgLongPoll(const Api* api, const EventHandler* eventHandler, std::int32_t limit, std::int32_t timeout, const std::shared_ptr<std::vector<std::string>>& allowupdates)
- : _api(api), _eventHandler(eventHandler), _limit(limit), _timeout(timeout), _allowupdates(allowupdates) {
+TgLongPoll::TgLongPoll(const Api* api, const EventHandler* eventHandler, std::int32_t limit, std::int32_t timeout, std::shared_ptr<std::vector<std::string>> allowUpdates)
+ : _api(api), _eventHandler(eventHandler), _limit(limit), _timeout(timeout),
+ _allowUpdates(std::move(allowUpdates)) {
}
-TgLongPoll::TgLongPoll(const Bot& bot, std::int32_t limit, std::int32_t timeout, const std::shared_ptr<std::vector<std::string>>& allowupdates) :
- TgLongPoll(&bot.getApi(), &bot.getEventHandler(), limit, timeout, allowupdates) {
+TgLongPoll::TgLongPoll(const Bot& bot, std::int32_t limit, std::int32_t timeout, const std::shared_ptr<std::vector<std::string>>& allowUpdates) :
+ TgLongPoll(&bot.getApi(), &bot.getEventHandler(), limit, timeout, allowUpdates) {
}
void TgLongPoll::start() {
- std::vector<Update::Ptr> updates = _api->getUpdates(_lastUpdateId, _limit, _timeout, _allowupdates);
+ std::vector<Update::Ptr> updates = _api->getUpdates(_lastUpdateId, _limit, _timeout, _allowUpdates);
for (Update::Ptr& item : updates) {
if (item->updateId >= _lastUpdateId) {
_lastUpdateId = item->updateId + 1;