diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-11-23 15:53:16 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-11-23 15:55:17 +0900 |
commit | 52081fe91724e5f2a82c55f0e6230d8841dd859a (patch) | |
tree | fce220aed26564ea66747cbbfc4031cbf2e7c865 /lib/room.cpp | |
parent | 49ad563550ba9d2d03fc7a519ccb857a6d08791c (diff) | |
download | libquotient-52081fe91724e5f2a82c55f0e6230d8841dd859a.tar.gz libquotient-52081fe91724e5f2a82c55f0e6230d8841dd859a.zip |
Room: track more Changes
Diffstat (limited to 'lib/room.cpp')
-rw-r--r-- | lib/room.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/room.cpp b/lib/room.cpp index 22a0d585..2a1d6f66 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -382,6 +382,7 @@ void Room::setJoinState(JoinState state) d->joinState = state; qCDebug(MAIN) << "Room" << id() << "changed state: " << int(oldState) << "->" << int(state); + emit changed(Change::JoinStateChange); emit joinStateChanged(oldState, state); } @@ -1112,11 +1113,11 @@ void Room::updateData(SyncRoomData&& data, bool fromCache) d->prevBatch = data.timelinePrevBatch; setJoinState(data.joinState); + Changes roomChanges = Change::NoChange; QElapsedTimer et; et.start(); for (auto&& event: data.accountData) - processAccountDataEvent(move(event)); + roomChanges |= processAccountDataEvent(move(event)); - Changes roomChanges = Change::NoChange; if (!data.state.empty()) { et.restart(); @@ -1973,7 +1974,7 @@ void Room::processEphemeralEvent(EventPtr&& event) } } -void Room::processAccountDataEvent(EventPtr&& event) +Room::Changes Room::processAccountDataEvent(EventPtr&& event) { if (auto* evt = eventCast<TagEvent>(event)) d->setTags(evt->tags()); @@ -2000,7 +2001,9 @@ void Room::processAccountDataEvent(EventPtr&& event) qCDebug(MAIN) << "Updated account data of type" << currentData->matrixType(); emit accountDataChanged(currentData->matrixType()); + return Change::AccountDataChange; } + return Change::NoChange; } QString Room::Private::roomNameFromMemberNames(const QList<User *> &userlist) const |