From edf8c2eb377b15053cf1cca3c0b03ad5aacec33b Mon Sep 17 00:00:00 2001 From: Daniel Brunner <0xFEEDC0DE64@gmail.com> Date: Fri, 5 May 2017 21:10:53 +0200 Subject: [PATCH 1/3] Fixed compilation under windows --- networking.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/networking.cpp b/networking.cpp index ee87b1f..d82aa85 100644 --- a/networking.cpp +++ b/networking.cpp @@ -1,5 +1,7 @@ #include "networking.h" +#include + using namespace Telegram; Networking::Networking(QString token, QObject *parent) : From 07f8f69cfd17affc9fc567a193642afa5a5b762b Mon Sep 17 00:00:00 2001 From: Daniel Brunner <0xFEEDC0DE64@gmail.com> Date: Fri, 5 May 2017 21:15:40 +0200 Subject: [PATCH 2/3] Fixed example not working (at runtime) --- examples/echo/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/echo/main.cpp b/examples/echo/main.cpp index c04170b..f95c03c 100644 --- a/examples/echo/main.cpp +++ b/examples/echo/main.cpp @@ -11,7 +11,7 @@ void newMessage(Telegram::Message message) qDebug() << "new message:" << message; if (bot && message.type == Telegram::Message::TextType) { - bot->sendMessage(message.from.id, message.string); + bot->sendMessage((qint32)message.from.id, message.string); } } @@ -19,7 +19,7 @@ int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); - bot = new Telegram::Bot(TOKEN, false, 500, 4); + bot = new Telegram::Bot(TOKEN, true, 500, 4); QObject::connect(bot, &Telegram::Bot::message, &newMessage); qDebug() << "Started Telegram Bot"; From 742900ecb4d21b188ca60f9699e4ff64f5c27932 Mon Sep 17 00:00:00 2001 From: Daniel Brunner <0xFEEDC0DE64@gmail.com> Date: Fri, 5 May 2017 21:20:41 +0200 Subject: [PATCH 3/3] Removed unnecessary int cast --- examples/echo/main.cpp | 2 +- types/chat.h | 2 +- types/user.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/echo/main.cpp b/examples/echo/main.cpp index f95c03c..20daea5 100644 --- a/examples/echo/main.cpp +++ b/examples/echo/main.cpp @@ -11,7 +11,7 @@ void newMessage(Telegram::Message message) qDebug() << "new message:" << message; if (bot && message.type == Telegram::Message::TextType) { - bot->sendMessage((qint32)message.from.id, message.string); + bot->sendMessage(message.from.id, message.string); } } diff --git a/types/chat.h b/types/chat.h index eec2bfb..99a3fb3 100644 --- a/types/chat.h +++ b/types/chat.h @@ -17,7 +17,7 @@ public: Private, Group, Channel }; - quint32 id; + qint32 id; ChatType type; QString title; QString username; diff --git a/types/user.h b/types/user.h index 1ab3682..f2af946 100644 --- a/types/user.h +++ b/types/user.h @@ -13,7 +13,7 @@ public: User() : id(0), firstname(QString()), lastname(QString()), username(QString()) {} User(QJsonObject user); - quint32 id; + qint32 id; QString firstname; QString lastname; QString username;