]> gitweb.ps.run Git - matrix_esp_thesis/blobdiff - src/matrix.h
share, save, load, init, print megolm out sessions
[matrix_esp_thesis] / src / matrix.h
index 32b8294c835dd82c90bc0276c6c378d21dbf783f..3614b6a74c4f89c91f268d47f8fbc041e654e962 100644 (file)
@@ -11,6 +11,7 @@
 \r
 \r
 #define USER_ID_SIZE 64\r
+#define ROOM_ID_SIZE 128\r
 #define SERVER_SIZE 20\r
 #define ACCESS_TOKEN_SIZE 40\r
 #define DEVICE_ID_SIZE 20\r
@@ -102,7 +103,7 @@ typedef struct MatrixMegolmInSession {
 } MatrixMegolmInSession;\r
 \r
 typedef struct MatrixMegolmOutSession {\r
-    const char * roomId;\r
+    char roomId[ROOM_ID_SIZE];\r
 \r
     OlmOutboundGroupSession * session;\r
     char memory[MEGOLM_OUTBOUND_SESSION_MEMORY_SIZE];\r
@@ -115,13 +116,25 @@ bool
 MatrixMegolmOutSessionInit(\r
     MatrixMegolmOutSession * session,\r
     const char * roomId);\r
-    \r
+\r
 bool\r
 MatrixMegolmOutSessionEncrypt(\r
     MatrixMegolmOutSession * session,\r
     const char * plaintext,\r
     char * outBuffer, int outBufferCap);\r
 \r
+bool\r
+MatrixMegolmOutSessionSave(\r
+    MatrixMegolmOutSession * session,\r
+    const char * filename,\r
+    const char * key);\r
+    \r
+bool\r
+MatrixMegolmOutSessionLoad(\r
+    MatrixMegolmOutSession * session,\r
+    const char * filename,\r
+    const char * key);\r
+\r
 \r
 // Matrix Client\r
 \r
@@ -156,6 +169,16 @@ MatrixClientInit(
     MatrixClient * client,\r
     const char * server);\r
 \r
+bool\r
+MatrixClientSave(\r
+    MatrixClient * client,\r
+    const char * filename);\r
+\r
+bool\r
+MatrixClientLoad(\r
+    MatrixClient * client,\r
+    const char * filename);\r
+\r
 bool\r
 MatrixClientSetAccessToken(\r
     MatrixClient * client,\r
@@ -242,6 +265,11 @@ MatrixClientSetMegolmOutSession(
     const char * roomId,\r
     MatrixMegolmOutSession session);\r
 \r
+bool\r
+MatrixClientInitMegolmOutSession(\r
+    MatrixClient * client,\r
+    const char * roomId);\r
+\r
 bool\r
 MatrixClientGetOlmSession(\r
     MatrixClient * client,\r