1 
2 #ifndef CLIMM_OSCAR_ROSTER_H
3 #define CLIMM_OSCAR_ROSTER_H
4 
5 #include "oscar_tlv.h"
6 
7 typedef enum {
8   roster_normal = 0,
9   roster_group = 1,
10   roster_visible = 2,
11   roster_invisible = 3,
12   roster_visibility = 4,
13   roster_presence = 5,
14   roster_icqtic = 9,
15   roster_ignore = 14,
16   roster_lastupd = 15,
17   roster_noncont = 16,
18   roster_wierd17 = 17,
19   roster_importt = 19,
20   roster_icon = 20,
21   roster_wierd25 = 25,
22   roster_wierd27 = 27,
23   roster_wierd29 = 29,
24   roster_wierd32 = 32
25 } roster_t;
26 
27 jump_snac_f SnacSrvReplylists, SnacSrvReplyroster, SnacSrvUpdateack,
28     SnacSrvRosterok, SnacSrvAuthreq, SnacSrvAuthreply, SnacSrvAddedyou,
29     SnacSrvRosterupdate, SnacSrvAddstart, SnacSrvAddend, SnacSrvRosteradd, SnacSrvRosterdelete;
30 
31 typedef struct RosterEntry_s RosterEntry;
32 typedef struct Roster_s Roster;
33 
34 struct RosterEntry_s {
35   RosterEntry *next;
36   char  *name;
37   char  *nick;
38   TLV   *tlv;
39   UWORD  tag;
40   UWORD  id;
41   UWORD  type;
42   unsigned short int reqauth:1;
43 };
44 
45 struct Roster_s {
46   RosterEntry *generic;
47   RosterEntry *groups;
48   RosterEntry *normal;
49   RosterEntry *visible;
50   RosterEntry *invisible;
51   RosterEntry *ignore;
52   time_t import;
53   char *ICQTIC;
54   char *delname;
55   UDWORD delid;
56   UDWORD deltag;
57 };
58 
59 Roster *OscarRosterC (void);
60 void    OscarRosterD (Roster *roster);
61 
62 
63 UDWORD SnacCliCheckroster (Server *serv);
64 void SnacCliRosterentryadd (Server *serv, const char *name, UWORD tag, UWORD id, UWORD type, UWORD tlv, void *data, UWORD len);
65 void SnacCliRosteraddgroup (Server *serv, ContactGroup *cg, int mode);
66 void SnacCliRosteraddcontact (Server *serv, Contact *cont, int mode);
67 void SnacCliRostermovecontact (Server *serv, Contact *cont, ContactGroup *cg, int mode);
68 void SnacCliRosterbulkmove (Server *serv, ContactGroup *cg, int mode);
69 void SnacCliRosterbulkadd (Server *serv, ContactGroup *cs);
70 void SnacCliRosterupdategroup (Server *serv, ContactGroup *cg, int mode);
71 void SnacCliRosterupdatecontact (Server *serv, Contact *cont, int mode);
72 void SnacCliRosterdeletegroup (Server *serv, ContactGroup *cg, int mode);
73 void SnacCliRosterdeletecontact (Server *serv, Contact *cont, int mode);
74 void SnacCliRosterentrydelete (Server *serv, RosterEntry *entry);
75 void SnacCliRosterdelete (Server *serv, const char *name, UWORD tag, UWORD id, roster_t type);
76 void SnacCliSetvisibility (Server *serv, char value, char islogin);
77 void SnacCliSetlastupdate (Server *serv);
78 void SnacCliAddstart (Server *serv);
79 void SnacCliAddend (Server *serv);
80 void SnacCliGrantauth (Server *serv, Contact *cont);
81 void SnacCliReqauth (Server *serv, Contact *cont, const char *msg);
82 void SnacCliAuthorize (Server *serv, Contact *cont, BOOL accept, const char *msg);
83 
84 #define SnacCliReqlists(serv)     SnacSend (serv, SnacC (serv, 19, 2, 0, 0))
85 #define SnacCliReqroster(serv)    SnacSend (serv, SnacC (serv, 19, 4, 0, 0))
86 #define SnacCliRosterack(serv)    SnacSend (serv, SnacC (serv, 19, 7, 0, 0))
87 
88 #endif
89