-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathext_chat.h
40 lines (32 loc) · 915 Bytes
/
ext_chat.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
#ifndef ext_chat_h
#define ext_chat_h
/*
#include "switch.h"
typedef struct chat_struct
{
char ep[32+1], id[32+1+64+1], idhash[9];
hashname_t origin;
switch_t s;
chan_t hub;
char rhash[9];
uint8_t local, seed[4];
uint16_t seq;
lob_t roster;
xht_t conn, log;
lob_t msgs;
char *join, *sent, *after;
} *chat_t;
chat_t ext_chat(chan_t c);
chat_t chat_get(switch_t s, char *id);
chat_t chat_free(chat_t chat);
// get the next incoming message (type state/message), caller must free
lob_t chat_pop(chat_t chat);
lob_t chat_message(chat_t chat);
chat_t chat_join(chat_t chat, lob_t join);
chat_t chat_send(chat_t chat, lob_t msg);
chat_t chat_add(chat_t chat, char *hn, char *val);
// get a participant or walk the list, returns the current state packet (immutable), online:true/false
lob_t chat_participant(chat_t chat, char *hn);
lob_t chat_iparticipant(chat_t chat, int index);
*/
#endif