diff options
Diffstat (limited to 'examples/qmc-example.cpp')
-rw-r--r-- | examples/qmc-example.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/examples/qmc-example.cpp b/examples/qmc-example.cpp index a5e5a481..652c1f92 100644 --- a/examples/qmc-example.cpp +++ b/examples/qmc-example.cpp @@ -140,8 +140,16 @@ void QMCTest::run() c->sync(10000); else if (targetRoom) { - targetRoom->postPlainText(origin % ": All tests finished"); - connect(targetRoom, &Room::messageSent, this, &QMCTest::leave); + // TODO: Waiting for proper futures to come so that it could be: +// targetRoom->postPlainText(origin % ": All tests finished") +// .then(this, &QMCTest::leave); + auto txnId = + targetRoom->postPlainText(origin % ": All tests finished"); + connect(targetRoom, &Room::messageSent, this, + [this,txnId] (QString serverTxnId) { + if (txnId == serverTxnId) + leave(); + }); } else finalize(); |