]> gitweb.ps.run Git - matrix_esp_thesis/blob - examples/Send.c
update code block to include 'c' specifier
[matrix_esp_thesis] / examples / Send.c
1 #include <matrix.h>\r
2 \r
3 #define SERVER        "https://matrix.org"\r
4 #define USER_ID       "@example:matrix.org"\r
5 #define ROOM_ID       "!example:matrix.org"\r
6 #define USERNAME      ""\r
7 #define PASSWORD      ""\r
8 #define DEVICE_NAME   ""\r
9 \r
10 int\r
11 main(void)\r
12 {\r
13     MatrixClient client;\r
14     MatrixClientInit(&client);\r
15     \r
16     MatrixHttpInit(&client.hc, SERVER);\r
17 \r
18 \r
19     MatrixClientSetUserId(&client, USER_ID);\r
20 \r
21     MatrixClientLoginPassword(&client,\r
22         USERNAME,\r
23         PASSWORD,\r
24         DEVICE_NAME);\r
25 \r
26 \r
27     MatrixClientSendEvent(&client,\r
28         ROOM_ID,\r
29         "m.room.message",\r
30         "{\"body\":\"Hello\",\"msgtype\":\"m.text\"}");\r
31         \r
32     \r
33     MatrixClientDeleteDevice(&client);\r
34         \r
35     MatrixHttpDeinit(&client.hc);\r
36 \r
37     return 0;\r
38 }\r