]> gitweb.ps.run Git - matrix_esp_thesis/blob - examples/Send.c
mongoose as http client
[matrix_esp_thesis] / examples / Send.c
1 #include <matrix.h>\r
2 \r
3 #define SERVER FixedBuf("matrix.org")\r
4 #define ACCESS_TOKEN FixedBuf("abc")\r
5 #define ROOM_ID FixedBuf("!jhpZBTbckszblMYjMK:matrix.org")\r
6 \r
7 int\r
8 main(\r
9     int argc,\r
10     char **argv)\r
11 {\r
12     MatrixClient client;\r
13     MatrixClientCreate(&client,\r
14         SERVER);\r
15 \r
16     MatrixClientSetAccessToken(&client,\r
17         ACCESS_TOKEN);\r
18 \r
19     MatrixClientSendEvent(&client,\r
20         ROOM_ID,\r
21         FixedBuf("m.room.message"),\r
22         FixedBuf("{\"body\":\"Hello\",\"msgtype\":\"m.text\"}"));\r
23 \r
24     return 0;\r
25 }