diff options
Diffstat (limited to 'examples/qmc-example.cpp')
-rw-r--r-- | examples/qmc-example.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/examples/qmc-example.cpp b/examples/qmc-example.cpp index 7b45a785..a6da6aba 100644 --- a/examples/qmc-example.cpp +++ b/examples/qmc-example.cpp @@ -1,12 +1,15 @@ -#include <iostream> -#include <QCoreApplication> #include "connection.h" #include "room.h" +#include <QCoreApplication> +#include <iostream> +#include <string> + using namespace QMatrixClient; using std::cout; using std::endl; +using std::string; void onNewRoom(Room* r) { @@ -16,11 +19,11 @@ void onNewRoom(Room* r) cout << " Name: " << r->name().toStdString() << endl; cout << " Canonical alias: " << r->canonicalAlias().toStdString() << endl; }); - QObject::connect(r, &Room::aboutToAddNewMessages, [=] (Events evs) { + QObject::connect(r, &Room::aboutToAddNewMessages, [=] (RoomEvents evs) { cout << "New events in room " << r->id().toStdString() << ":" << endl; for (auto e: evs) { - cout << e->originalJson().toStdString() << endl; + cout << string(e->originalJson()) << endl; } }); } |