forked from notsecure/uTox
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfriend.h
57 lines (46 loc) · 1.12 KB
/
friend.h
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*todo: */
enum {
FT_NONE,
FT_SEND,
FT_PENDING,
FT_PAUSE,
FT_BROKE,
FT_KILL,
FT_FINISHED,
};
enum {
FILE_PENDING,
FILE_OK,
FILE_PAUSED,
FILE_BROKEN,
FILE_KILLED,
FILE_DONE,
};
typedef struct {
/* used by the tox thread */
uint8_t status, filenumber, name_length;
_Bool finish;
uint16_t sendsize, buffer_bytes;
uint32_t fid;
void *data, *buffer;
uint64_t bytes, total;
uint8_t name[128];
uint64_t lastupdate, lastprogress;
/* used by the main thread */
void *chatdata;
} FILE_T;
typedef struct {
_Bool online, typing;
uint8_t calling, status;
int32_t callid;
uint8_t cid[TOX_CLIENT_ID_SIZE];
uint16_t name_length, status_length, typed_length;
char_t *name, *status_message, *typed;
MSG_DATA msg;
FILE_T incoming[16];
FILE_T outgoing[16];
} FRIEND;
void friend_setname(FRIEND *f, uint8_t *name, uint16_t length);
void friend_addmessage(FRIEND *f, void *data);
void friend_addid(uint8_t *id, char_t *msg, uint16_t msg_length);
void friend_add(char_t *name, uint16_t length, char_t *msg, uint16_t msg_length);