aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2017-12-09 17:36:04 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2017-12-10 16:18:34 +0900
commit552031b1809a9bb7e596d12e21e50c40c91b0f21 (patch)
tree16e51e0c2f97f4f776d12e6fbc9327acd8fb9a87
parent2b4952b6686f647c5470033de2cb14577cfb41f1 (diff)
downloadlibquotient-552031b1809a9bb7e596d12e21e50c40c91b0f21.tar.gz
libquotient-552031b1809a9bb7e596d12e21e50c40c91b0f21.zip
Use the generated PostReceiptJob; don't compile unused job classes
Rewire Connection::postReceipt() to the generated job too; this call is still deprecated though.
-rw-r--r--CMakeLists.txt2
-rw-r--r--connection.cpp4
-rw-r--r--room.cpp5
3 files changed, 5 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 29a5c811..1cf871a3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -71,10 +71,8 @@ set(libqmatrixclient_SRCS
events/receiptevent.cpp
jobs/basejob.cpp
jobs/checkauthmethods.cpp
- jobs/passwordlogin.cpp
jobs/sendeventjob.cpp
jobs/setroomstatejob.cpp
- jobs/postreceiptjob.cpp
jobs/joinroomjob.cpp
jobs/roommessagesjob.cpp
jobs/syncjob.cpp
diff --git a/connection.cpp b/connection.cpp
index d4f6bf61..4fb661f3 100644
--- a/connection.cpp
+++ b/connection.cpp
@@ -23,8 +23,8 @@
#include "room.h"
#include "jobs/generated/login.h"
#include "jobs/generated/logout.h"
+#include "jobs/generated/receipts.h"
#include "jobs/sendeventjob.h"
-#include "jobs/postreceiptjob.h"
#include "jobs/joinroomjob.h"
#include "jobs/roommessagesjob.h"
#include "jobs/syncjob.h"
@@ -281,7 +281,7 @@ void Connection::postMessage(Room* room, const QString& type, const QString& mes
PostReceiptJob* Connection::postReceipt(Room* room, RoomEvent* event) const
{
- return callApi<PostReceiptJob>(room->id(), event->id());
+ return callApi<PostReceiptJob>(room->id(), "m.read", event->id());
}
JoinRoomJob* Connection::joinRoom(const QString& roomAlias)
diff --git a/room.cpp b/room.cpp
index 3beac1b2..764f4d23 100644
--- a/room.cpp
+++ b/room.cpp
@@ -22,6 +22,7 @@
#include "jobs/generated/inviting.h"
#include "jobs/generated/banning.h"
#include "jobs/generated/leaving.h"
+#include "jobs/generated/receipts.h"
#include "jobs/setroomstatejob.h"
#include "events/simplestateevents.h"
#include "events/roomavatarevent.h"
@@ -30,7 +31,6 @@
#include "events/receiptevent.h"
#include "jobs/sendeventjob.h"
#include "jobs/roommessagesjob.h"
-#include "jobs/postreceiptjob.h"
#include "avatar.h"
#include "connection.h"
#include "user.h"
@@ -283,7 +283,8 @@ void Room::markMessagesAsRead(Room::rev_iter_t upToMarker)
{
if ((*markers.second)->senderId() != localUser()->id())
{
- connection()->callApi<PostReceiptJob>(id(), (*markers.second)->id());
+ connection()->callApi<PostReceiptJob>(
+ id(), "m.read", (*markers.second)->id());
break;
}
}