abouttreesummaryrefslogcommitdiff
path: root/src/matrix.h
diff options
context:
space:
mode:
authorPatrick2023-05-28 17:27:25 +0200
committerPatrick2023-05-28 17:27:25 +0200
commitd382d193cb2d550cc769afa76e55823865a39023 (patch)
tree45ee240e02e28ed65b566fb8ece7ad0fbbe4064e /src/matrix.h
parentc1547dd3565f979d08a9e8e9eec8f42956e6901c (diff)
downloadmatrix_esp_thesis-d382d193cb2d550cc769afa76e55823865a39023.tar.gz
matrix_esp_thesis-d382d193cb2d550cc769afa76e55823865a39023.zip
send example, http PUT
Diffstat (limited to 'src/matrix.h')
-rw-r--r--src/matrix.h28
1 files changed, 25 insertions, 3 deletions
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];
@@ -36,11 +36,23 @@ MatrixClientInit(
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