]> gitweb.ps.run Git - matrix_esp_thesis/commitdiff
add libolm.a to Makefile
authorPatrick <patrick.schoenberger@posteo.de>
Thu, 29 Jun 2023 05:12:19 +0000 (07:12 +0200)
committerPatrick <patrick.schoenberger@posteo.de>
Thu, 29 Jun 2023 05:12:19 +0000 (07:12 +0200)
Makefile
examples/Keys.c [new file with mode: 0644]

index 8197ee5b4ffdd60824214a7383d44cb87b54b06b..bfcb1dec63e1705ef42f59c9a3a8842b85fcc77d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -26,4 +26,9 @@ out/examples/%: examples/%.c src/*
 \r
 .PHONY: examples\r
 \r
-examples: out/examples/Login out/examples/Send out/examples/SendEncrypted out/examples/Sync
\ No newline at end of file
+examples: out/examples/Login out/examples/Send out/examples/SendEncrypted out/examples/Sync\r
+\r
+out/olm/libolm.a:\r
+       cd out/olm\r
+       cmake -DBUILD_SHARED_LIBS=OFF -DOLM_TESTS=OFF ../../ext/olm\r
+       cmake --build .
\ No newline at end of file
diff --git a/examples/Keys.c b/examples/Keys.c
new file mode 100644 (file)
index 0000000..77196ba
--- /dev/null
@@ -0,0 +1,28 @@
+#include <matrix.h>\r
+#include <stdio.h>\r
+\r
+#define SERVER       "https://matrix.org"\r
+#define ACCESS_TOKEN "syt_cHNjaG8_yBvTjVTquGCikvsAenOJ_49mBMO"\r
+#define DEVICE_ID    "MAZNCCZLBR"\r
+#define USER_ID      "@pscho:matrix.org"\r
+#define ROOM_ID      "!XKFUjAsGrSSrpDFIxB:matrix.org"\r
+\r
+int\r
+main(void)\r
+{\r
+    MatrixClient client;\r
+    MatrixClientInit(&client,\r
+        SERVER);\r
+    \r
+    MatrixHttpInit(&client);\r
+\r
+    MatrixClientGenerateOnetimeKeys(&client,\r
+        10);\r
+    \r
+    MatrixClientUploadDeviceKeys(&client);\r
+    MatrixClientUploadOnetimeKeys(&client);\r
+        \r
+    MatrixHttpDeinit(&client);\r
+\r
+    return 0;\r
+}\r