From 564d518c086f2aeab0f0466b7cd1915e20edc7da Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Thu, 3 May 2018 21:23:28 +0900 Subject: GetRoomEventsJob (replaces RoomMessagesJob) + refactoring 1. Updates in this commit (see further) allow to generate and build GetRoomEventsJob from message_pagination.yaml; this job completely preempts RoomMessagesJob. 2. EventsBatch<> is no more a thing; there's EventsArray<> to replace it but it's loaded from a JSON array rather than an event batch (a JSON array inside another JSON object). SyncJob that used it extensively has been moved to "conventional" containers (Events, RoomEvents and the newly introduced StateEvents). RoomMessagesJob that also used EventsBatch<> is decommissioned (see above). 3. RoomEventsRange is now an alias for Range, defined in util.h (otherwise almost the same). 4. Connection::getMessages() is no more. Use Room::getPreviousContent() and Connection::callApi() instead. 5. Moving things around in Room, since SyncJob now supplies state events in more specific StateEvents, rather than RoomEvents. --- lib/connection.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'lib/connection.cpp') diff --git a/lib/connection.cpp b/lib/connection.cpp index adeb7929..b433ccbc 100644 --- a/lib/connection.cpp +++ b/lib/connection.cpp @@ -30,7 +30,6 @@ #include "jobs/generated/account-data.h" #include "jobs/sendeventjob.h" #include "jobs/joinroomjob.h" -#include "jobs/roommessagesjob.h" #include "jobs/syncjob.h" #include "jobs/mediathumbnailjob.h" #include "jobs/downloadfilejob.h" @@ -372,11 +371,6 @@ void Connection::leaveRoom(Room* room) callApi(room->id()); } -RoomMessagesJob* Connection::getMessages(Room* room, const QString& from) const -{ - return callApi(room->id(), from); -} - inline auto splitMediaId(const QString& mediaId) { auto idParts = mediaId.split('/'); -- cgit v1.2.3 From a5b6d786878ab5c67a7b436ba475e8ac4d22f1f0 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Thu, 3 May 2018 22:41:12 +0900 Subject: Preempt jobs/joinroomjob.* with jobs/generated/joining.* Enables responding to third-party invites. --- lib/connection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/connection.cpp') diff --git a/lib/connection.cpp b/lib/connection.cpp index b433ccbc..05640c66 100644 --- a/lib/connection.cpp +++ b/lib/connection.cpp @@ -28,8 +28,8 @@ #include "jobs/generated/receipts.h" #include "jobs/generated/leaving.h" #include "jobs/generated/account-data.h" +#include "jobs/generated/joining.h" #include "jobs/sendeventjob.h" -#include "jobs/joinroomjob.h" #include "jobs/syncjob.h" #include "jobs/mediathumbnailjob.h" #include "jobs/downloadfilejob.h" -- cgit v1.2.3 From e49a842e877d17a1c6cbbb2349c2816639447721 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 4 May 2018 19:09:57 +0900 Subject: Connection, jobs/generated: Use QStringList instead of QVector QStringList's API is richer, after all. --- lib/connection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/connection.cpp') diff --git a/lib/connection.cpp b/lib/connection.cpp index 05640c66..78ce4777 100644 --- a/lib/connection.cpp +++ b/lib/connection.cpp @@ -441,7 +441,7 @@ DownloadFileJob* Connection::downloadFile(const QUrl& url, CreateRoomJob* Connection::createRoom(RoomVisibility visibility, const QString& alias, const QString& name, const QString& topic, - const QVector& invites, const QString& presetName, + const QStringList& invites, const QString& presetName, bool isDirect, bool guestsCanJoin, const QVector& initialState, const QVector& invite3pids, -- cgit v1.2.3 From 49022915fde72b83d9f18944c268110b01fa3469 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 4 May 2018 23:04:04 +0900 Subject: New home for the generated code - lib/csapi --- lib/connection.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/connection.cpp') diff --git a/lib/connection.cpp b/lib/connection.cpp index 78ce4777..24bf1af9 100644 --- a/lib/connection.cpp +++ b/lib/connection.cpp @@ -23,12 +23,12 @@ #include "events/directchatevent.h" #include "room.h" #include "settings.h" -#include "jobs/generated/login.h" -#include "jobs/generated/logout.h" -#include "jobs/generated/receipts.h" -#include "jobs/generated/leaving.h" -#include "jobs/generated/account-data.h" -#include "jobs/generated/joining.h" +#include "csapi/login.h" +#include "csapi/logout.h" +#include "csapi/receipts.h" +#include "csapi/leaving.h" +#include "csapi/account-data.h" +#include "csapi/joining.h" #include "jobs/sendeventjob.h" #include "jobs/syncjob.h" #include "jobs/mediathumbnailjob.h" -- cgit v1.2.3