abouttreesummaryrefslogcommitdiff
path: root/examples/Send.c
diff options
context:
space:
mode:
authorPatrick2023-05-15 18:47:59 +0200
committerPatrick2023-05-15 18:47:59 +0200
commitd43e8671acc5709c192e159e0d91626f0677cdf1 (patch)
tree85d2c65ddb3c36bea1e9ea814cf9434e52fcae97 /examples/Send.c
downloadmatrix_esp_thesis-d43e8671acc5709c192e159e0d91626f0677cdf1.tar.gz
matrix_esp_thesis-d43e8671acc5709c192e159e0d91626f0677cdf1.zip
Initial commit. Rudimentary readme, mockup examples without actual implementation, Makefile, Olm submodule
Diffstat (limited to 'examples/Send.c')
-rw-r--r--examples/Send.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/examples/Send.c b/examples/Send.c
new file mode 100644
index 0000000..95167cc
--- /dev/null
+++ b/examples/Send.c
@@ -0,0 +1,25 @@
+#include <matrix.h>
+
+#define SERVER FixedBuf("matrix.org")
+#define ACCESS_TOKEN FixedBuf("abc")
+#define ROOM_ID FixedBuf("!jhpZBTbckszblMYjMK:matrix.org")
+
+int
+main(
+ int argc,
+ char **argv)
+{
+ MatrixClient client;
+ MatrixClientCreate(&client,
+ SERVER);
+
+ MatrixClientSetAccessToken(&client,
+ ACCESS_TOKEN);
+
+ MatrixClientSendEvent(&client,
+ ROOM_ID,
+ FixedBuf("m.room.message"),
+ FixedBuf("{\"body\":\"Hello\",\"msgtype\":\"m.text\"}"));
+
+ return 0;
+} \ No newline at end of file