]> gitweb.ps.run Git - matrix_esp_thesis/blobdiff - src/matrix.h
start working on Sync example (reply to to_device messages)
[matrix_esp_thesis] / src / matrix.h
index b51d0e99fc3469c612d21e09fd6c5312f7be0324..da0e85930b726169adbcd3fd0dcbe663b58f884f 100644 (file)
@@ -17,7 +17,7 @@
 #define DEVICE_ID_SIZE 20\r
 #define EXPIRE_MS_SIZE 20\r
 #define REFRESH_TOKEN_SIZE 20\r
-#define MAX_URL_LEN 128\r
+#define MAX_URL_LEN 1024\r
 \r
 #define OLM_IDENTITY_KEYS_JSON_SIZE 128\r
 #define DEVICE_KEY_SIZE 44\r
@@ -119,6 +119,13 @@ MatrixOlmSessionEncrypt(
     const char * plaintext,\r
     char * outBuffer, int outBufferCap);\r
 \r
+bool\r
+MatrixOlmSessionDecrypt(\r
+    MatrixOlmSession * session,\r
+    size_t messageType,\r
+    char * encrypted,\r
+    char * outBuffer, int outBufferCap);\r
+\r
 \r
 // Matrix Megolm Session\r
 \r
@@ -126,6 +133,12 @@ typedef struct MatrixMegolmInSession {
     OlmInboundGroupSession * session;\r
 } MatrixMegolmInSession;\r
 \r
+bool\r
+MatrixMegolmInSessionDecrypt(\r
+    MatrixMegolmInSession * megolmInSession,\r
+    const char * encrypted,\r
+    char * outDecrypted, int outDecryptedCap);\r
+\r
 typedef struct MatrixMegolmOutSession {\r
     char roomId[ROOM_ID_SIZE];\r
 \r
@@ -262,7 +275,15 @@ MatrixClientSendEventEncrypted(
 bool\r
 MatrixClientSync(\r
     MatrixClient * client,\r
-    char * outSync, int outSyncCap);\r
+    char * outSync, int outSyncCap,\r
+    const char * nextBatch);\r
+\r
+bool\r
+MatrixClientGetRoomEvent(\r
+    MatrixClient * client,\r
+    const char * roomId,\r
+    const char * eventId,\r
+    char * outEvent, int outEventCap);\r
 \r
 bool\r
 MatrixClientShareMegolmOutSession(\r
@@ -294,6 +315,16 @@ bool
 MatrixClientInitMegolmOutSession(\r
     MatrixClient * client,\r
     const char * roomId);\r
+    \r
+bool\r
+MatrixClientRequestMegolmInSession(\r
+    MatrixClient * client,\r
+    const char * roomId,\r
+    const char * sessionId,\r
+    const char * senderKey,\r
+    const char * userId,\r
+    const char * deviceId, // TODO: remove deviceId (query all devices)\r
+    MatrixMegolmInSession * outMegolmInSession);\r
 \r
 bool\r
 MatrixClientGetOlmSession(\r
@@ -318,6 +349,12 @@ MatrixClientSendToDeviceEncrypted(
     const char * message,\r
     const char * msgType);\r
 \r
+bool\r
+MatrixClientSendDummy(\r
+    MatrixClient * client,\r
+    const char * userId,\r
+    const char * deviceId);\r
+\r
 bool\r
 MatrixClientRequestDeviceKey(\r
     MatrixClient * client,\r