]> gitweb.ps.run Git - matrix_esp_thesis/blobdiff - examples/Send.c
remove newline
[matrix_esp_thesis] / examples / Send.c
index cddb96615ef3e1a56f6a1d3cc833e07b13cd01d0..d5d27b97208580ee25d253bdf5f41134cc0beb7c 100644 (file)
@@ -1,28 +1,38 @@
 #include <matrix.h>\r
 \r
 #include <matrix.h>\r
 \r
-#define SERVER       "https://matrix.org"\r
-#define ACCESS_TOKEN "syt_cHNjaG8_yBvTjVTquGCikvsAenOJ_49mBMO"\r
-#define DEVICE_ID    "MAZNCCZLBR"\r
-#define ROOM_ID      "!koVStwyiiKcBVbXZYz:matrix.org"\r
+#define SERVER        "https://matrix.org"\r
+#define USER_ID       "@example:matrix.org"\r
+#define ROOM_ID       "!example:matrix.org"\r
+#define USERNAME      ""\r
+#define PASSWORD      ""\r
+#define DEVICE_NAME   ""\r
 \r
 int\r
 main(void)\r
 {\r
     MatrixClient client;\r
 \r
 int\r
 main(void)\r
 {\r
     MatrixClient client;\r
-    MatrixClientInit(&client,\r
-        SERVER);\r
+    MatrixClientInit(&client);\r
     \r
     \r
-    MatrixHttpInit(&client);\r
+    MatrixHttpInit(&client.hc, SERVER);\r
+\r
+\r
+    MatrixClientSetUserId(&client, USER_ID);\r
+\r
+    MatrixClientLoginPassword(&client,\r
+        USERNAME,\r
+        PASSWORD,\r
+        DEVICE_NAME);\r
 \r
 \r
-    MatrixClientSetAccessToken(&client,\r
-        ACCESS_TOKEN);\r
 \r
     MatrixClientSendEvent(&client,\r
         ROOM_ID,\r
         "m.room.message",\r
         "{\"body\":\"Hello\",\"msgtype\":\"m.text\"}");\r
         \r
 \r
     MatrixClientSendEvent(&client,\r
         ROOM_ID,\r
         "m.room.message",\r
         "{\"body\":\"Hello\",\"msgtype\":\"m.text\"}");\r
         \r
-    MatrixHttpDeinit(&client);\r
+    \r
+    MatrixClientDeleteDevice(&client);\r
+        \r
+    MatrixHttpDeinit(&client.hc);\r
 \r
     return 0;\r
 \r
     return 0;\r
-}
\ No newline at end of file
+}\r