X-Git-Url: https://gitweb.ps.run/matrix_esp_thesis/blobdiff_plain/c1547dd3565f979d08a9e8e9eec8f42956e6901c..d382d193cb2d550cc769afa76e55823865a39023:/src/matrix.h diff --git a/src/matrix.h b/src/matrix.h index cd109ce..2e7f6e0 100644 --- a/src/matrix.h +++ b/src/matrix.h @@ -21,7 +21,7 @@ typedef struct MatrixClient { OlmAccount * olmAccount; OlmSession * olmSession; - char server[SERVER_SIZE]; + char server[SERVER_SIZE+1]; char accessTokenBuffer[ACCESS_TOKEN_SIZE]; char deviceIdBuffer[DEVICE_ID_SIZE]; char expireMsBuffer[EXPIRE_MS_SIZE]; @@ -35,12 +35,24 @@ MatrixClientInit( MatrixClient * client, const char * server); +bool +MatrixClientSetAccessToken( + MatrixClient * client, + const char * accessToken); + bool MatrixClientLoginPassword( MatrixClient * client, const char * username, const char * password, const char * displayName); + +bool +MatrixClientSendEvent( + MatrixClient * client, + const char * roomId, + const char * msgType, + const char * msgBody); bool MatrixHttpInit( @@ -54,13 +66,23 @@ bool MatrixHttpGet( MatrixClient * client, const char * url, - char * outResponseBuffer, int outResponseCap); + char * outResponseBuffer, int outResponseCap, + bool authenticated); bool MatrixHttpPost( MatrixClient * client, const char * url, const char * requestBuffer, - char * outResponseBuffer, int outResponseCap); + char * outResponseBuffer, int outResponseCap, + bool authenticated); + +bool +MatrixHttpPut( + MatrixClient * client, + const char * url, + const char * requestBuffer, + char * outResponseBuffer, int outResponseCap, + bool authenticated); #endif