From d382d193cb2d550cc769afa76e55823865a39023 Mon Sep 17 00:00:00 2001 From: Patrick Date: Sun, 28 May 2023 17:27:25 +0200 Subject: send example, http PUT --- src/matrix.h | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to '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 -- cgit v1.2.3