diff --git a/src/example/deploy/qTbot.json b/src/example/deploy/qTbot.json index af6230b..5ebe096 100644 --- a/src/example/deploy/qTbot.json +++ b/src/example/deploy/qTbot.json @@ -21,7 +21,7 @@ ], "extraLib": "crypto", "targetDir": "/media/D/builds/qTbot/Distro", - "deployVersion": "0.24.f96a9a8", + "deployVersion": "0.27.79b33b3", } diff --git a/src/example/main.cpp b/src/example/main.cpp index b41aefd..a7a064c 100644 --- a/src/example/main.cpp +++ b/src/example/main.cpp @@ -10,6 +10,7 @@ #include #include +#include int main(int argc, char *argv[]) { @@ -22,25 +23,29 @@ int main(int argc, char *argv[]) { qTbot::TelegramRestBot bot; QList > filesStack; - QObject::connect(&bot, &qTbot::TelegramRestBot::sigReceiveMessage, [&bot, &filesStack](auto){ - while(auto&& msg = bot.takeNextUnreadMessage()) { + QObject::connect(&bot, &qTbot::TelegramRestBot::sigReceiveUpdate, [&bot, &filesStack](auto){ + while(auto&& update = bot.takeNextUnreadUpdate()) { - if (auto&& tmsg = msg.dynamicCast()) { + if (auto&& tupdate = update.dynamicCast()) { + + if (tupdate->contains(tupdate->MessageUpdate)) { + + if (auto&& tmsg = tupdate->message()) { + if (tmsg->contains(tmsg->Document)) { + filesStack.push_back(bot.getFile(tmsg->documents()->fileId(), qTbot::iFile::Local)); + } + + if (tmsg->contains(tmsg->Image)) { + filesStack.push_back(bot.getFile(tmsg->image()->fileId(), qTbot::iFile::Local)); + } + + if (tmsg->contains(tmsg->Audio)) { + filesStack.push_back(bot.getFile(tmsg->audio()->fileId(), qTbot::iFile::Local)); + } + bot.sendSpecificMessage(tmsg->chatId(), "I see it - я вижу это", tmsg->messageId()); + } - if (tmsg->contains(tmsg->Document)) { - filesStack.push_back(bot.getFile(tmsg->documents()->fileId(), qTbot::iFile::Local)); } - - if (tmsg->contains(tmsg->Image)) { - filesStack.push_back(bot.getFile(tmsg->image()->fileId(), qTbot::iFile::Local)); - } - - if (tmsg->contains(tmsg->Audio)) { - filesStack.push_back(bot.getFile(tmsg->audio()->fileId(), qTbot::iFile::Local)); - } - - bot.sendSpecificMessage(tmsg->chatId(), "I see it - я вижу это", tmsg->messageId()); - } } }); diff --git a/src/qTbot/src/public/qTbot/file.cpp b/src/qTbot/src/public/qTbot/file.cpp index 9032468..11e6097 100644 --- a/src/qTbot/src/public/qTbot/file.cpp +++ b/src/qTbot/src/public/qTbot/file.cpp @@ -36,6 +36,7 @@ void File::handleReadReady() { if (bytes.size()) { _localFile.write(bytes); + _localFile.flush(); } } diff --git a/src/qTbot/src/public/qTbot/global.h b/src/qTbot/src/public/qTbot/global.h index 6f3d0d8..a086172 100644 --- a/src/qTbot/src/public/qTbot/global.h +++ b/src/qTbot/src/public/qTbot/global.h @@ -10,7 +10,7 @@ #include -#define QTBOT_VERSION "0.24.f96a9a8" +#define QTBOT_VERSION "0.27.79b33b3" #if defined(QTBOT_LIBRARY) # define QTBOT_EXPORT Q_DECL_EXPORT diff --git a/src/qTbot/src/public/qTbot/ibot.cpp b/src/qTbot/src/public/qTbot/ibot.cpp index 425dbae..0c0d709 100644 --- a/src/qTbot/src/public/qTbot/ibot.cpp +++ b/src/qTbot/src/public/qTbot/ibot.cpp @@ -27,18 +27,18 @@ void IBot::setToken(const QByteArray &newToken) { _token = newToken; } -void IBot::incomeNewMessage(const QSharedPointer &message) { +void IBot::incomeNewUpdate(const QSharedPointer &message) { if (!message->isValid()) return; - auto id = message->messageId(); + auto id = message->updateId(); if (!_processed.contains(id)) { _processed.insert(id); - _notProcessedMessages[message->messageId()] = message; + _notProcessedUpdates[id] = message; - emit sigReceiveMessage(message); + emit sigReceiveUpdate(message); } } @@ -68,15 +68,15 @@ QSharedPointer IBot::sendRequest(const QSharedPointer & return networkReplay; } -void IBot::markMessageAsProcessed(const QSharedPointer &message) { - _notProcessedMessages.remove(message->messageId()); +void IBot::markUpdateAsProcessed(const QSharedPointer &message) { + _notProcessedUpdates.remove(message->updateId()); } -void IBot::markMessageAsUnprocessed(const QSharedPointer &message) { - return markMessageAsUnprocessed(message->messageId()); +void IBot::markUpdateAsUnprocessed(const QSharedPointer &message) { + return markUpdateAsUnprocessed(message->updateId()); } -void IBot::markMessageAsUnprocessed(unsigned long long messageID) { +void IBot::markUpdateAsUnprocessed(unsigned long long messageID) { _processed.remove(messageID); } @@ -108,10 +108,10 @@ void IBot::setName(const QString &newName) { _name = newName; } -QSharedPointer IBot::takeNextUnreadMessage() { - if (_notProcessedMessages.size()) { - auto toRemove = std::move(*_notProcessedMessages.begin()); - _notProcessedMessages.erase(_notProcessedMessages.cbegin()); +QSharedPointer IBot::takeNextUnreadUpdate() { + if (_notProcessedUpdates.size()) { + auto toRemove = std::move(*_notProcessedUpdates.begin()); + _notProcessedUpdates.erase(_notProcessedUpdates.cbegin()); return toRemove; } diff --git a/src/qTbot/src/public/qTbot/ibot.h b/src/qTbot/src/public/qTbot/ibot.h index c2ae326..5b0d4e0 100644 --- a/src/qTbot/src/public/qTbot/ibot.h +++ b/src/qTbot/src/public/qTbot/ibot.h @@ -10,7 +10,7 @@ #define IBOT_H #include "qTbot/global.h" -#include "qTbot/imessage.h" +#include "qTbot/iupdate.h" #include "qTbot/irequest.h" #include "ifile.h" @@ -85,10 +85,10 @@ public: void setName(const QString &newName); /** - * @brief takeNextUnreadMessage This method take a unread message and mark them as read. + * @brief takeNextUnreadUpdate This method take a unread update and mark them as read. * @return unread message object. If all messages is readed the return nullptr. */ - QSharedPointer takeNextUnreadMessage(); + QSharedPointer takeNextUnreadUpdate(); /** * @brief processed This method return list of processed mesages. @@ -155,29 +155,29 @@ protected: void setToken(const QByteArray &newToken); /** - * @brief incomeNewMessage This method save income message into store. + * @brief incomeNewUpdate This method save incomed messages into store. */ - virtual void incomeNewMessage(const QSharedPointer& message); + virtual void incomeNewUpdate(const QSharedPointer& message); /** * @brief markMessageAsProcessed This method remove message from the not processed messages store. * @param message This is message that need to be processed. */ - void markMessageAsProcessed(const QSharedPointer& message); + void markUpdateAsProcessed(const QSharedPointer& message); /** * @brief markMessageAsUnprocessed This method add the message into a not processed messages store. * @param message This is message that need to be unprocessed. * @note this may be useful for the process edited old messages. Just call this method bofore IBot::incomeNewMessage. */ - void markMessageAsUnprocessed(const QSharedPointer& message); + void markUpdateAsUnprocessed(const QSharedPointer& message); /** * @brief markMessageAsUnprocessed This method add the message into a not processed messages store. * @param message This is message that need to be unprocessed. * @note this may be useful for the process edited old messages. Just call this method bofore IBot::incomeNewMessage. */ - void markMessageAsUnprocessed(unsigned long long messageID); + void markUpdateAsUnprocessed(unsigned long long messageID); /** * @brief defaultFileStorageLocation This method return default file storage location. @@ -186,16 +186,16 @@ protected: virtual QString defaultFileStorageLocation() const; signals: /** - * @brief sigReceiveMessage emit when but receive any updates from users. + * @brief sigReceiveUpdate emit when but receive any updates from users. */ - void sigReceiveMessage(const QSharedPointer& ); + void sigReceiveUpdate(const QSharedPointer& ); private: void doRemoveFinishedRequests(); QByteArray _token; QString _name; - QMap> _notProcessedMessages; + QMap> _notProcessedUpdates; QSet _processed; QNetworkAccessManager *_manager = nullptr; diff --git a/src/qTbot/src/public/qTbot/ijsonbasedmessage.cpp b/src/qTbot/src/public/qTbot/ijsonbasedupdate.cpp similarity index 68% rename from src/qTbot/src/public/qTbot/ijsonbasedmessage.cpp rename to src/qTbot/src/public/qTbot/ijsonbasedupdate.cpp index 86e5f27..6f91dc4 100644 --- a/src/qTbot/src/public/qTbot/ijsonbasedmessage.cpp +++ b/src/qTbot/src/public/qTbot/ijsonbasedupdate.cpp @@ -6,21 +6,21 @@ //# -#include "ijsonbasedmessage.h" +#include "ijsonbasedupdate.h" #include "qjsondocument.h" namespace qTbot { -IJsonBasedMessage::IJsonBasedMessage() { +IJsonBasedUpdate::IJsonBasedUpdate() { } -bool IJsonBasedMessage::isValid() const { +bool IJsonBasedUpdate::isValid() const { return !rawJson().empty(); } -void IJsonBasedMessage::setRawData(const QByteArray &newRawData) { - iMessage::setRawData(newRawData); +void IJsonBasedUpdate::setRawData(const QByteArray &newRawData) { + iUpdate::setRawData(newRawData); auto doc = QJsonDocument::fromJson(newRawData); if (!doc.isObject()) { diff --git a/src/qTbot/src/public/qTbot/ijsonbasedmessage.h b/src/qTbot/src/public/qTbot/ijsonbasedupdate.h similarity index 61% rename from src/qTbot/src/public/qTbot/ijsonbasedmessage.h rename to src/qTbot/src/public/qTbot/ijsonbasedupdate.h index 8dfb7ed..cfcf6e8 100644 --- a/src/qTbot/src/public/qTbot/ijsonbasedmessage.h +++ b/src/qTbot/src/public/qTbot/ijsonbasedupdate.h @@ -6,10 +6,10 @@ //# -#ifndef IJSONBASEDMESSAGE_H -#define IJSONBASEDMESSAGE_H +#ifndef IJSONBASEDUPDATE_H +#define IJSONBASEDUPDATE_H -#include "imessage.h" +#include "iupdate.h" #include "qTbot/ijsonbasedobject.h" #include @@ -17,16 +17,16 @@ namespace qTbot { /** - * @brief The IJsonBasedMessage class This is message that have a json sructure + * @brief The IJsonBasedUpdate class This is updates that have a json sructure */ -class QTBOT_EXPORT IJsonBasedMessage: public iMessage, public IJsonBasedObject +class QTBOT_EXPORT IJsonBasedUpdate: public iUpdate, public IJsonBasedObject { public: - IJsonBasedMessage(); + IJsonBasedUpdate(); // iMessage interface bool isValid() const override; void setRawData(const QByteArray &newRawData) override; }; } -#endif // IJSONBASEDMESSAGE_H +#endif // IJSONBASEDUPDATE_H diff --git a/src/qTbot/src/public/qTbot/itelegrambot.cpp b/src/qTbot/src/public/qTbot/itelegrambot.cpp index f074d02..0245e8e 100644 --- a/src/qTbot/src/public/qTbot/itelegrambot.cpp +++ b/src/qTbot/src/public/qTbot/itelegrambot.cpp @@ -6,7 +6,6 @@ //# #include "itelegrambot.h" -#include "qTbot/messages/telegrammsg.h" #include "qTbot/messages/telegramupdateanswer.h" #include "file.h" #include "qTbot/requests/telegrammdownloadfile.h" @@ -24,6 +23,7 @@ #include #include +#include namespace qTbot { diff --git a/src/qTbot/src/public/qTbot/itelegrambot.h b/src/qTbot/src/public/qTbot/itelegrambot.h index b922219..ee0b37f 100644 --- a/src/qTbot/src/public/qTbot/itelegrambot.h +++ b/src/qTbot/src/public/qTbot/itelegrambot.h @@ -11,6 +11,7 @@ #define ITELEGRAMBOT_H #include "ibot.h" +#include "qTbot/messages/telegrammsg.h" #include class QNetworkAccessManager; @@ -144,6 +145,7 @@ public: const QString& username() const; protected: + /** * @brief setId This method sets new value for the ITelegramBot::id property. * @param newId this is new value of the ITelegramBot::id property. @@ -193,6 +195,7 @@ private: QHash> _filesMetaInfo; + }; } #endif // ITELEGRAMBOT_H diff --git a/src/qTbot/src/public/qTbot/imessage.cpp b/src/qTbot/src/public/qTbot/iupdate.cpp similarity index 66% rename from src/qTbot/src/public/qTbot/imessage.cpp rename to src/qTbot/src/public/qTbot/iupdate.cpp index 38eb1ab..8bb2cf5 100644 --- a/src/qTbot/src/public/qTbot/imessage.cpp +++ b/src/qTbot/src/public/qTbot/iupdate.cpp @@ -5,23 +5,23 @@ //# of this license document, but changing it is not allowed. //# -#include "imessage.h" +#include "iupdate.h" namespace qTbot { -iMessage::iMessage() { +iUpdate::iUpdate() { } -const QByteArray& iMessage::rawData() const { +const QByteArray& iUpdate::rawData() const { return _rawData; } -void iMessage::setRawData(const QByteArray &newRawData) { +void iUpdate::setRawData(const QByteArray &newRawData) { _rawData = newRawData; } -bool iMessage::isValid() const { +bool iUpdate::isValid() const { return _rawData.size(); } diff --git a/src/qTbot/src/public/qTbot/imessage.h b/src/qTbot/src/public/qTbot/iupdate.h similarity index 86% rename from src/qTbot/src/public/qTbot/imessage.h rename to src/qTbot/src/public/qTbot/iupdate.h index 8f48a6f..7893d32 100644 --- a/src/qTbot/src/public/qTbot/imessage.h +++ b/src/qTbot/src/public/qTbot/iupdate.h @@ -7,8 +7,8 @@ -#ifndef IMESSAGE_H -#define IMESSAGE_H +#ifndef IUPDATE_H +#define IUPDATE_H #include "qTbot/global.h" #include @@ -25,10 +25,10 @@ namespace qTbot { * @see IBot::takeNextUnreadMessage * @see IBot::makeMesasge */ -class QTBOT_EXPORT iMessage +class QTBOT_EXPORT iUpdate { public: - iMessage(); + iUpdate(); /** * @brief rawData returns raw data of the message. @@ -62,14 +62,14 @@ public: virtual QVariant chatId() const = 0; /** - * @brief messageId This method returns numeric id of the message. - * @return numeric id of the message. + * @brief updateId This method returns numeric id of the update. + * @return numeric id of the update. */ - virtual unsigned long long messageId() const = 0; + virtual unsigned long long updateId() const = 0; private: QByteArray _rawData; }; } -#endif // IMESSAGE_H +#endif // IUPDATE_H diff --git a/src/qTbot/src/public/qTbot/messages/itelegrammessage.cpp b/src/qTbot/src/public/qTbot/messages/imessage.cpp similarity index 65% rename from src/qTbot/src/public/qTbot/messages/itelegrammessage.cpp rename to src/qTbot/src/public/qTbot/messages/imessage.cpp index 2e02c07..5ae4865 100644 --- a/src/qTbot/src/public/qTbot/messages/itelegrammessage.cpp +++ b/src/qTbot/src/public/qTbot/messages/imessage.cpp @@ -5,12 +5,10 @@ //# of this license document, but changing it is not allowed. //# +#include "imessage.h" -#include "itelegrammessage.h" -#include -namespace qTbot { - -ITelegramMessage::ITelegramMessage():IJsonBasedMessage(){} +qTbot::iMessage::iMessage() +{ } diff --git a/src/qTbot/src/public/qTbot/messages/imessage.h b/src/qTbot/src/public/qTbot/messages/imessage.h new file mode 100644 index 0000000..16af61b --- /dev/null +++ b/src/qTbot/src/public/qTbot/messages/imessage.h @@ -0,0 +1,29 @@ +//# +//# Copyright (C) 2023-2023 QuasarApp. +//# Distributed under the GPLv3 software license, see the accompanying +//# Everyone is permitted to copy and distribute verbatim copies +//# of this license document, but changing it is not allowed. +//# + +#ifndef IMESSAGE_H +#define IMESSAGE_H + +#include "qTbot/ijsonbasedupdate.h" +namespace qTbot { + +/** + * @brief The iMessage class This is main interface for the all messages. + */ +class QTBOT_EXPORT iMessage: public IJsonBasedUpdate +{ +public: + iMessage(); + + /** + * @brief updateId This method returns numeric id of the message. + * @return numeric id of the message. + */ + virtual unsigned long long messageId() const = 0; +}; +} +#endif // IMESSAGE_H diff --git a/src/qTbot/src/public/qTbot/messages/itelegrammessage.h b/src/qTbot/src/public/qTbot/messages/itelegrammessage.h deleted file mode 100644 index de829ce..0000000 --- a/src/qTbot/src/public/qTbot/messages/itelegrammessage.h +++ /dev/null @@ -1,26 +0,0 @@ -//# -//# Copyright (C) 2023-2023 QuasarApp. -//# Distributed under the GPLv3 software license, see the accompanying -//# Everyone is permitted to copy and distribute verbatim copies -//# of this license document, but changing it is not allowed. -//# - - -#ifndef ITELEGRAMMESSAGE_H -#define ITELEGRAMMESSAGE_H - -#include "qTbot/ijsonbasedmessage.h" - -namespace qTbot { - -/** - * @brief The ItelegramMessage class This is base interface of the all telegram messages. - */ -class QTBOT_EXPORT ITelegramMessage: public IJsonBasedMessage -{ -public: - ITelegramMessage(); -}; - -} -#endif // ITELEGRAMMESSAGE_H diff --git a/src/qTbot/src/public/qTbot/messages/telegrammsg.cpp b/src/qTbot/src/public/qTbot/messages/telegrammsg.cpp index 26905df..ed8f14e 100644 --- a/src/qTbot/src/public/qTbot/messages/telegrammsg.cpp +++ b/src/qTbot/src/public/qTbot/messages/telegrammsg.cpp @@ -163,4 +163,8 @@ QSharedPointer TelegramMsg::audio() const { return QSharedPointer::create(rawJson()[Audio].toObject()); } +unsigned long long TelegramMsg::updateId() const { + return 0; +} + } diff --git a/src/qTbot/src/public/qTbot/messages/telegrammsg.h b/src/qTbot/src/public/qTbot/messages/telegrammsg.h index dc6bb66..8527a8d 100644 --- a/src/qTbot/src/public/qTbot/messages/telegrammsg.h +++ b/src/qTbot/src/public/qTbot/messages/telegrammsg.h @@ -8,7 +8,7 @@ #ifndef TELEGRAMMSG_H #define TELEGRAMMSG_H -#include "itelegrammessage.h" +#include "imessage.h" #include "telegramaudio.h" #include "telegramdocument.h" #include "qTbot/messages/telegramimage.h" @@ -19,7 +19,7 @@ namespace qTbot { * @brief The TelegramMsg class This class provide general mesasges of telegram. * The message object can contains text, geo or link to video,image. all this dates can be contains in one object. */ -class QTBOT_EXPORT TelegramMsg: public ITelegramMessage +class QTBOT_EXPORT TelegramMsg: public iMessage { public: @@ -200,7 +200,7 @@ public: */ QSharedPointer audio() const; - + unsigned long long updateId() const override; }; } diff --git a/src/qTbot/src/public/qTbot/messages/telegramupdate.cpp b/src/qTbot/src/public/qTbot/messages/telegramupdate.cpp index 225a8cc..3a0137a 100644 --- a/src/qTbot/src/public/qTbot/messages/telegramupdate.cpp +++ b/src/qTbot/src/public/qTbot/messages/telegramupdate.cpp @@ -16,12 +16,13 @@ bool TelegramUpdate::contains(const Type &type) { return rawJson().contains(type); } -QJsonObject TelegramUpdate::message() const { - return rawJson().value(MessageUpdate).toObject(); +QSharedPointer TelegramUpdate::message() const { + return QSharedPointer::create(rawJson()[MessageUpdate].toObject()); } -QJsonObject TelegramUpdate::editedMessage() const { - return rawJson().value(EditedMessageUpdate).toObject(); +QSharedPointer TelegramUpdate::editedMessage() const { + return QSharedPointer::create(rawJson()[EditedMessageUpdate].toObject()); + } QJsonObject TelegramUpdate::channelPost() const { @@ -88,7 +89,4 @@ QVariant TelegramUpdate::chatId() const { return ""; } -unsigned long long TelegramUpdate::messageId() const { - return 0; -} } diff --git a/src/qTbot/src/public/qTbot/messages/telegramupdate.h b/src/qTbot/src/public/qTbot/messages/telegramupdate.h index c33a9a1..3355cc5 100644 --- a/src/qTbot/src/public/qTbot/messages/telegramupdate.h +++ b/src/qTbot/src/public/qTbot/messages/telegramupdate.h @@ -8,13 +8,16 @@ #ifndef TELEGRAMUPDATE_H #define TELEGRAMUPDATE_H -#include "qTbot/messages/itelegrammessage.h" + +#include +#include "telegrammsg.h" + namespace qTbot { /** * @brief The TelegramUpdate class contains base information about updates from telegram */ -class QTBOT_EXPORT TelegramUpdate: public ITelegramMessage +class QTBOT_EXPORT TelegramUpdate: public IJsonBasedUpdate { public: TelegramUpdate(); @@ -50,13 +53,13 @@ public: * @brief message returns the array of the updates messages. * @return list of updates. */ - QJsonObject message() const; + QSharedPointer message() const; /** * @brief editedMessage returns the edited message update. * @return QJsonObject containing the edited message update. */ - QJsonObject editedMessage() const; + QSharedPointer editedMessage() const; /** * @brief channelPost returns the channel post update. @@ -134,13 +137,12 @@ public: * @brief updateId returns the update ID. * @return The update ID. */ - unsigned long long updateId() const; + unsigned long long updateId() const override; // iMessage interface public: bool isValid() const override; QString from() const override; QVariant chatId() const override; - unsigned long long messageId() const override; }; } #endif // TELEGRAMUPDATE_H diff --git a/src/qTbot/src/public/qTbot/messages/telegramupdateanswer.cpp b/src/qTbot/src/public/qTbot/messages/telegramupdateanswer.cpp index 671071d..548ba8e 100644 --- a/src/qTbot/src/public/qTbot/messages/telegramupdateanswer.cpp +++ b/src/qTbot/src/public/qTbot/messages/telegramupdateanswer.cpp @@ -34,7 +34,7 @@ QVariant TelegramUpdateAnswer::chatId() const { return {}; } -unsigned long long TelegramUpdateAnswer::messageId() const { +unsigned long long TelegramUpdateAnswer::updateId() const { return 0; } diff --git a/src/qTbot/src/public/qTbot/messages/telegramupdateanswer.h b/src/qTbot/src/public/qTbot/messages/telegramupdateanswer.h index 387f45e..ff292c6 100644 --- a/src/qTbot/src/public/qTbot/messages/telegramupdateanswer.h +++ b/src/qTbot/src/public/qTbot/messages/telegramupdateanswer.h @@ -6,17 +6,18 @@ //# + #ifndef TELEGRAMUPDATEANSVER_H #define TELEGRAMUPDATEANSVER_H -#include "itelegrammessage.h" +#include namespace qTbot { /** * @brief The TelegramUpdateAnswer class This is base message from the telegram server after update request. */ -class TelegramUpdateAnswer: public ITelegramMessage +class TelegramUpdateAnswer: public IJsonBasedUpdate { public: TelegramUpdateAnswer(); @@ -45,7 +46,7 @@ public: QString from() const override; QVariant chatId() const override; - unsigned long long messageId() const override; + unsigned long long updateId() const override; }; diff --git a/src/qTbot/src/public/qTbot/telegramrestbot.cpp b/src/qTbot/src/public/qTbot/telegramrestbot.cpp index 91e37b5..91f15b8 100644 --- a/src/qTbot/src/public/qTbot/telegramrestbot.cpp +++ b/src/qTbot/src/public/qTbot/telegramrestbot.cpp @@ -74,7 +74,7 @@ void TelegramRestBot::handleReceiveUpdates(const QWeakPointer &re auto && resultArray = telegramMsg->result().toArray(); for (const auto& ref: resultArray) { auto&& update = IBot::makeMesasge(ref.toObject()); - incomeNewMessage(IBot::makeMesasge(update->message())); + incomeNewUpdate(update); } } }