From b055b4a6630b06f3fc243dedac2951dc361b72f4 Mon Sep 17 00:00:00 2001 From: timoreo Date: Sat, 9 Dec 2023 15:36:46 +0100 Subject: [PATCH] Upload keys endpoint --- include/matrixclient.h | 1 + source/matrixclient.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/include/matrixclient.h b/include/matrixclient.h index 8fff9e3..66c351f 100644 --- a/include/matrixclient.h +++ b/include/matrixclient.h @@ -95,6 +95,7 @@ public: void setRoomInfoCallback(roomInfoCallback cb); void setRoomLimitedCallback(roomLimitedCallback cb); void syncLoop(); + void uploadKeys(json_t* body); }; }; // namespace Matrix diff --git a/source/matrixclient.cpp b/source/matrixclient.cpp index 53fe40c..9372434 100644 --- a/source/matrixclient.cpp +++ b/source/matrixclient.cpp @@ -312,6 +312,14 @@ void Client::sendReadReceipt(std::string roomId, std::string eventId) { } } +void Client::uploadKeys(json_t* body) { + std::string path = "/_matrix/client/v3/keys/upload/"; + json_t* ret = doRequest("POST", path, body); + if (ret) { + json_decref(ret); + } +} + void Client::setTyping(std::string roomId, bool typing, u32 timeout) { roomId = resolveRoom(roomId); std::string userId = getUserId();