diff options
| author | Patrick | 2023-11-13 22:28:23 +0100 |
|---|---|---|
| committer | Patrick | 2023-11-13 22:28:23 +0100 |
| commit | ef693c75de0b5719d47ab404616bf97b9f901524 (patch) | |
| tree | 336a4b76845ad076825c2bb66dad59cd170faed6 /src/matrix.h | |
| parent | 710b0b6b9b5d3e3c21d430a3604f7e3a8b2a60de (diff) | |
| download | matrix_esp_thesis-ef693c75de0b5719d47ab404616bf97b9f901524.tar.gz matrix_esp_thesis-ef693c75de0b5719d47ab404616bf97b9f901524.zip | |
matrix.h: change NUM_DEVICES, add masterKey and verified, add HandleSync/HandleEvent
Diffstat (limited to 'src/matrix.h')
| -rw-r--r-- | src/matrix.h | 54 |
1 files changed, 24 insertions, 30 deletions
diff --git a/src/matrix.h b/src/matrix.h index c07c742..81b6170 100644 --- a/src/matrix.h +++ b/src/matrix.h @@ -23,6 +23,7 @@ #define DEVICE_KEY_SIZE 44
#define SIGNING_KEY_SIZE 44
#define ONETIME_KEY_SIZE 44
+#define MASTER_KEY_SIZE 44
#define KEY_SHARE_EVENT_LEN 1024
@@ -49,7 +50,7 @@ #define NUM_MEGOLM_SESSIONS 2
#define NUM_OLM_SESSIONS 2
-#define NUM_DEVICES 5
+#define NUM_DEVICES 10
// HTTP
@@ -60,10 +61,6 @@ MatrixHttpInit( MatrixHttpConnection ** hc,
const char * host);
-// bool
-// MatrixHttpConnect(
-// MatrixHttpConnection * hc);
-
bool
MatrixHttpDeinit(
MatrixHttpConnection ** hc);
@@ -227,18 +224,6 @@ MatrixMegolmOutSessionEncrypt( const char * plaintext,
char * outBuffer, int outBufferCap);
-bool
-MatrixMegolmOutSessionSave(
- MatrixMegolmOutSession * session,
- const char * filename,
- const char * key);
-
-bool
-MatrixMegolmOutSessionLoad(
- MatrixMegolmOutSession * session,
- const char * filename,
- const char * key);
-
// Matrix Client
@@ -263,6 +248,9 @@ typedef struct MatrixClient { char deviceId[DEVICE_ID_SIZE];
char expireMs[EXPIRE_MS_SIZE];
char refreshToken[REFRESH_TOKEN_SIZE];
+ char masterKey[MASTER_KEY_SIZE];
+
+ bool verified;
MatrixHttpConnection * hc;
} MatrixClient;
@@ -272,16 +260,6 @@ MatrixClientInit( MatrixClient * client);
bool
-MatrixClientSave(
- MatrixClient * client,
- const char * filename);
-
-bool
-MatrixClientLoad(
- MatrixClient * client,
- const char * filename);
-
-bool
MatrixClientSetAccessToken(
MatrixClient * client,
const char * accessToken);
@@ -306,7 +284,7 @@ MatrixClientUploadOnetimeKeys( MatrixClient * client);
bool
-MatrixClientUploadDeviceKey(
+MatrixClientUploadDeviceKeys(
MatrixClient * client);
bool
@@ -337,11 +315,22 @@ MatrixClientSendEventEncrypted( const char * msgType,
const char * msgBody);
+void
+HandleEvent(
+ MatrixClient * client,
+ const char * event, int eventLen);
+
+void
+HandleRoomEvent(
+ MatrixClient * client,
+ const char * room, int roomLen,
+ const char * event, int eventLen);
+
bool
MatrixClientSync(
MatrixClient * client,
- char * outSync, int outSyncCap,
- const char * nextBatch);
+ char * outSyncBuffer, int outSyncCap,
+ char * nextBatch, int nextBatchCap);
bool
MatrixClientGetRoomEvent(
@@ -457,6 +446,11 @@ MatrixClientRequestSigningKey( char * outSigningKey, int outSigningKeyCap);
bool
+MatrixClientRequestMasterKey(
+ MatrixClient * client,
+ char * outMasterKey, int outMasterKeyCap);
+
+bool
MatrixClientRequestDeviceKeys(
MatrixClient * client);
|
