blob: 1ffbbc0a44897e017d81332bef4980072d49e79c (
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
|
#include <stdio.h>
#include <matrix.h>
#define SERVER "https://matrix.org"
#define USERNAME "pscho"
#define PASSWORD "Wc23EbmB9G3faMq"
#define DISPLAYNAME "MatrixClient"
int
main(void)
{
MatrixClient client;
MatrixClientInit(&client,
SERVER);
MatrixHttpInit(&client);
MatrixClientLoginPassword(&client,
USERNAME,
PASSWORD,
DISPLAYNAME);
printf("Access Token: %s\n", client.accessToken);
printf("Device ID: %s\n", client.deviceId);
printf("Expires in (ms): %s\n", client.expireMs);
printf("Refresh Token: %s\n", client.refreshToken);
MatrixHttpDeinit(&client);
return 0;
}
|