\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
} 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
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
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
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