abouttreesummaryrefslogcommitdiff
path: root/examples
diff options
context:
space:
mode:
authorPatrick2023-07-10 20:57:49 +0200
committerPatrick2023-07-10 20:57:49 +0200
commit6646bd126f9faf1e687b203512d29da243acaa90 (patch)
treeb69b1217c08a954b83bdc74ee5aeb37ba794b23c /examples
parentf2840d9dd5b8a0683abee189e408c5a6de294eb7 (diff)
downloadmatrix_esp_thesis-6646bd126f9faf1e687b203512d29da243acaa90.tar.gz
matrix_esp_thesis-6646bd126f9faf1e687b203512d29da243acaa90.zip
more changes towards sharing megolm sessions
Diffstat (limited to 'examples')
-rw-r--r--examples/Keys.c2
-rw-r--r--examples/SendEncrypted.c12
-rw-r--r--examples/Sync.c5
3 files changed, 11 insertions, 8 deletions
diff --git a/examples/Keys.c b/examples/Keys.c
index f59a1d5..f79488b 100644
--- a/examples/Keys.c
+++ b/examples/Keys.c
@@ -25,6 +25,8 @@ main(void)
MatrixClientUploadOnetimeKeys(&client);
MatrixClientUploadDeviceKeys(&client);
+
+ printf("device key: %s\n", client.deviceKey);
MatrixHttpDeinit(&client);
diff --git a/examples/SendEncrypted.c b/examples/SendEncrypted.c
index 7e0b1d4..0005592 100644
--- a/examples/SendEncrypted.c
+++ b/examples/SendEncrypted.c
@@ -23,18 +23,20 @@ main(void)
MatrixClientSetUserId(&client,
USER_ID);
- // MatrixMegolmOutSession megolmOutSession;
- // MatrixMegolmOutSessionInit(&megolmOutSession);
- // MatrixClientSetMegolmOutSession(&client,
- // ROOM_ID,
- // megolmOutSession);
+ MatrixClientUploadDeviceKeys(&client);
MatrixClientSendEventEncrypted(&client,
ROOM_ID,
"m.room.message",
"{\"body\":\"Hello\",\"msgtype\":\"m.text\"}");
+ MatrixClientSendToDeviceEncrypted(&client,
+ USER_ID,
+ "ULZZOKJBYN",
+ "{}",
+ "m.dummy");
+
MatrixClientShareMegolmOutSession(&client,
USER_ID,
"ULZZOKJBYN",
diff --git a/examples/Sync.c b/examples/Sync.c
index a49cf65..e845056 100644
--- a/examples/Sync.c
+++ b/examples/Sync.c
@@ -3,7 +3,6 @@
#define SERVER "https://matrix.org"
#define ACCESS_TOKEN "syt_cHNjaG8_yBvTjVTquGCikvsAenOJ_49mBMO"
-#define DEVICE_ID "MAZNCCZLBR"
int
main(void)
@@ -17,9 +16,9 @@ main(void)
MatrixClientSetAccessToken(&client,
ACCESS_TOKEN);
- static char syncBuffer[20000];
+ static char syncBuffer[40000];
MatrixClientSync(&client,
- syncBuffer, 20000);
+ syncBuffer, 40000);
printf("%s", syncBuffer);
MatrixHttpDeinit(&client);