diff options
Diffstat (limited to 'lib/connectiondata.cpp')
-rw-r--r-- | lib/connectiondata.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/connectiondata.cpp b/lib/connectiondata.cpp index 486de03d..41d97b87 100644 --- a/lib/connectiondata.cpp +++ b/lib/connectiondata.cpp @@ -29,10 +29,11 @@ struct ConnectionData::Private { QUrl baseUrl; QByteArray accessToken; QString lastEvent; + QString userId; QString deviceId; mutable unsigned int txnCounter = 0; - const qint64 id = QDateTime::currentMSecsSinceEpoch(); + const qint64 txnBase = QDateTime::currentMSecsSinceEpoch(); }; ConnectionData::ConnectionData(QUrl baseUrl) @@ -75,12 +76,15 @@ void ConnectionData::setPort(int port) const QString& ConnectionData::deviceId() const { return d->deviceId; } +const QString& ConnectionData::userId() const { return d->userId; } + void ConnectionData::setDeviceId(const QString& deviceId) { d->deviceId = deviceId; - qCDebug(MAIN) << "updated deviceId to" << d->deviceId; } +void ConnectionData::setUserId(const QString& userId) { d->userId = userId; } + QString ConnectionData::lastEvent() const { return d->lastEvent; } void ConnectionData::setLastEvent(QString identifier) @@ -90,5 +94,6 @@ void ConnectionData::setLastEvent(QString identifier) QByteArray ConnectionData::generateTxnId() const { - return QByteArray::number(d->id) + 'q' + QByteArray::number(++d->txnCounter); + return d->deviceId.toLatin1() + QByteArray::number(d->txnBase) + + QByteArray::number(++d->txnCounter); } |