abouttreesummaryrefslogcommitdiff
path: root/src/matrix.h
blob: 5f53e0e0a74678553992a8b01f71b5306aa5c5ee (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
#ifndef MATRIX__H
#define MATRIX__H

#include <stdbool.h>
#include <string.h>

#include <olm/olm.h>

#include "fixedbuffer.h"



#define ACCESS_TOKEN_LEN 20 // TODO: fix

typedef struct MatrixClient {
    OlmAccount * olmAcc;
    char accessToken[ACCESS_TOKEN_LEN];
} MatrixClient;

bool
MatrixClientInit(
    MatrixClient * client,
    FixedBuffer server
);

bool
MatrixClientLoginPassword(
    MatrixClient * client,
    FixedBuffer username,
    FixedBuffer password
);

bool
MatrixClientGetAccessToken(
    MatrixClient * client,
    FixedBuffer * outBuffer
);

#endif