Upload keys endpoint

This commit is contained in:
timoreo 2023-12-09 15:36:46 +01:00
parent 833de44d81
commit b055b4a663
Signed by: timoreo
GPG key ID: 121A72C3512BA288
2 changed files with 9 additions and 0 deletions

View file

@ -95,6 +95,7 @@ public:
void setRoomInfoCallback(roomInfoCallback cb);
void setRoomLimitedCallback(roomLimitedCallback cb);
void syncLoop();
void uploadKeys(json_t* body);
};
}; // namespace Matrix

View file

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