aboutsummaryrefslogtreecommitdiff
path: root/room.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-03-05 10:08:30 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-03-05 10:24:10 +0900
commit0be3571d7c96e3df7ec523217e02d58850c7fe73 (patch)
treeaa733d890ee6617a0eca0634cb604f6f0266f6da /room.cpp
parentbc08637eaaf25fb83b685e48e86553d3edacc09a (diff)
downloadlibquotient-0be3571d7c96e3df7ec523217e02d58850c7fe73.tar.gz
libquotient-0be3571d7c96e3df7ec523217e02d58850c7fe73.zip
Support saving account data on the server
Closes #152. Saving of specific event types should be added separately.
Diffstat (limited to 'room.cpp')
-rw-r--r--room.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/room.cpp b/room.cpp
index cfa705bb..e03a2b5b 100644
--- a/room.cpp
+++ b/room.cpp
@@ -24,6 +24,7 @@
#include "jobs/generated/leaving.h"
#include "jobs/generated/receipts.h"
#include "jobs/generated/redaction.h"
+#include "jobs/generated/account-data.h"
#include "jobs/setroomstatejob.h"
#include "events/simplestateevents.h"
#include "events/roomavatarevent.h"
@@ -202,6 +203,13 @@ class Room::Private
*/
void processRedaction(RoomEventPtr redactionEvent);
+ template <typename EvT>
+ SetAccountDataPerRoomJob* setAccountData(const EvT& event)
+ {
+ return connection->callApi<SetAccountDataPerRoomJob>(
+ connection->userId(), id, EvT::typeId(), event.toJson());
+ }
+
QJsonObject toJson() const;
private: