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();