X-Git-Url: https://gitweb.ps.run/matrix_esp_thesis/blobdiff_plain/c1547dd3565f979d08a9e8e9eec8f42956e6901c..9eaa420b7bf51cc81c50e7f4ca0f256498a07c86:/examples/Send.c diff --git a/examples/Send.c b/examples/Send.c index 8786be9..9ab7dfb 100644 --- a/examples/Send.c +++ b/examples/Send.c @@ -1,26 +1,36 @@ #include -#define SERVER "matrix.org" -#define ACCESS_TOKEN "syt_cHNjaG8_yBvTjVTquGCikvsAenOJ_49mBMO" -#define DEVICE_ID "MAZNCCZLBR" -#define ROOM_ID "!jhpZBTbckszblMYjMK:matrix.org" +#define SERVER "https://matrix.org" +#define USER_ID "@pscho:matrix.org" +#define ROOM_ID "!koVStwyiiKcBVbXZYz:matrix.org" int -main() +main(void) { MatrixClient client; - MatrixClientCreate(&client, - SERVER, strlen(SERVER)); + MatrixClientInit(&client, + SERVER); MatrixHttpInit(&client); - MatrixClientSetAccessToken(&client, - ACCESS_TOKEN, strlen(ACCESS_TOKEN)); + + MatrixClientSetUserId(&client, USER_ID); + + MatrixClientLoginPassword(&client, + "pscho", + "Wc23EbmB9G3faMq", + "Test1"); + MatrixClientSendEvent(&client, ROOM_ID, "m.room.message", "{\"body\":\"Hello\",\"msgtype\":\"m.text\"}"); + + + MatrixClientDeleteDevice(&client); + + MatrixHttpDeinit(&client); return 0; } \ No newline at end of file