abouttreesummaryrefslogcommitdiff
path: root/examples/SendEncrypted.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/SendEncrypted.c')
-rw-r--r--examples/SendEncrypted.c40
1 files changed, 22 insertions, 18 deletions
diff --git a/examples/SendEncrypted.c b/examples/SendEncrypted.c
index 2d3bd74..db2f83c 100644
--- a/examples/SendEncrypted.c
+++ b/examples/SendEncrypted.c
@@ -1,32 +1,36 @@
#include <matrix.h>
+#include <stdio.h>
-#define SERVER FixedBuf("matrix.org")
-#define ACCESS_TOKEN FixedBuf("abc")
-#define ROOM_ID FixedBuf("!jhpZBTbckszblMYjMK:matrix.org")
+#define SERVER "https://matrix.org"
+#define ACCESS_TOKEN "syt_cHNjaG8_yBvTjVTquGCikvsAenOJ_49mBMO"
+#define DEVICE_ID "MAZNCCZLBR"
+#define ROOM_ID "!koVStwyiiKcBVbXZYz:matrix.org"
int
-main(
- int argc,
- char **argv)
+main(void)
{
MatrixClient client;
- MatrixClientCreate(&client,
+ MatrixClientInit(&client,
SERVER);
+
+ MatrixHttpInit(&client);
MatrixClientSetAccessToken(&client,
ACCESS_TOKEN);
- MatrixMegolmSession megolm;
- MatrixMegolmSessionInit(&megolm);
-
- MatrixRoomShareMegolmSession(&client,
- ROOM_ID,
- megolm);
-
- MatrixClientSendGroupEncrypted(&client,
+ // MatrixMegolmOutSession megolmOutSession;
+ // MatrixMegolmOutSessionInit(&megolmOutSession);
+
+ // MatrixClientSetMegolmOutSession(&client,
+ // ROOM_ID,
+ // megolmOutSession);
+
+ MatrixClientSendEventEncrypted(&client,
ROOM_ID,
- FixedBuf("m.room.message"),
- FixedBuf("{\"body\":\"Hello\",\"msgtype\":\"m.text\"}"));
+ "m.room.message",
+ "{\"body\":\"Hello\",\"msgtype\":\"m.text\"}");
+
+ MatrixHttpDeinit(&client);
return 0;
-} \ No newline at end of file
+}