blob: 7cc506e46ee6b0792e49c43623c7810faf54d49b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#include <matrix.h>
#include <stdio.h>
#define SERVER "https://matrix.org"
#define ACCESS_TOKEN "syt_cHNjaG8_yBvTjVTquGCikvsAenOJ_49mBMO"
#define DEVICE_ID "MAZNCCZLBR"
#define USER_ID "@pscho:matrix.org"
#define ROOM_ID "!XKFUjAsGrSSrpDFIxB:matrix.org"
int
main(void)
{
MatrixClient client;
MatrixClientInit(&client);
MatrixHttpInit(&client.hc, SERVER);
MatrixClientSetAccessToken(&client,
ACCESS_TOKEN);
MatrixClientSetDeviceId(&client,
DEVICE_ID);
MatrixClientSetUserId(&client,
USER_ID);
MatrixClientSendEventEncrypted(&client,
ROOM_ID,
"m.room.message",
"{\"body\":\"Hello\",\"msgtype\":\"m.text\"}");
MatrixClientShareMegolmOutSession(&client,
USER_ID,
"ULZZOKJBYN",
&client.megolmOutSessions[0]);
MatrixHttpDeinit(&client.hc);
return 0;
}
|