aboutsummaryrefslogtreecommitdiff
path: root/jobs
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2017-09-09 20:17:42 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2017-09-09 20:17:42 +0900
commit442470d4fcc565d54086caecdb07e9a046b26333 (patch)
tree395419ea42c3f06351fb81ab94f124afef0ef3fd /jobs
parent1c86ff91b5db9bd6757e8149df462d4247fef90c (diff)
downloadlibquotient-442470d4fcc565d54086caecdb07e9a046b26333.tar.gz
libquotient-442470d4fcc565d54086caecdb07e9a046b26333.zip
Kicking, inviting, exposing rooms in Invite state
Kicking and inviting use generated job classes. Rooms in Invite state are stored separately in the hash from those in Join/Leave state because The Spec says so. For clients, this means that the same room may appear twice in the rooms map if it's been left and then the user was again invited to it. The code in Quaternion that properly processes this will arrive shortly.
Diffstat (limited to 'jobs')
-rw-r--r--jobs/syncjob.cpp5
-rw-r--r--jobs/syncjob.h1
2 files changed, 2 insertions, 4 deletions
diff --git a/jobs/syncjob.cpp b/jobs/syncjob.cpp
index 29ddc2e6..38cfcb2a 100644
--- a/jobs/syncjob.cpp
+++ b/jobs/syncjob.cpp
@@ -99,15 +99,14 @@ SyncRoomData::SyncRoomData(const QString& roomId_, JoinState joinState_,
const QJsonObject& room_)
: roomId(roomId_)
, joinState(joinState_)
- , state("state")
+ , state(joinState == JoinState::Invite ? "invite_state" : "state")
, timeline("timeline")
, ephemeral("ephemeral")
, accountData("account_data")
- , inviteState("invite_state")
{
switch (joinState) {
case JoinState::Invite:
- inviteState.fromJson(room_);
+ state.fromJson(room_);
break;
case JoinState::Join:
state.fromJson(room_);
diff --git a/jobs/syncjob.h b/jobs/syncjob.h
index 07824e23..57a87c9f 100644
--- a/jobs/syncjob.h
+++ b/jobs/syncjob.h
@@ -51,7 +51,6 @@ namespace QMatrixClient
Batch<RoomEvent> timeline;
Batch<Event> ephemeral;
Batch<Event> accountData;
- Batch<Event> inviteState;
bool timelineLimited;
QString timelinePrevBatch;