1 /* $Id: im_response.h 2516 2008-03-04 22:53:59Z kuhlmann $ */
2 
3 #ifndef CLIMM_IM_RESPONSE_H
4 #define CLIMM_IM_RESPONSE_H
5 
6 void HistShow (Contact *cont);
7 void HistMsg (Server *conn, Contact *cont, time_t stamp, const char *msg, UWORD inout);
8 
9 typedef enum { pm_leaf, pm_parent } parentmode_t;
10 typedef enum { st_on, st_ch, st_off } change_t;
11 
12 typedef enum {
13   INT_FILE_ACKED, INT_FILE_REJED, INT_FILE_ACKING, INT_FILE_REJING, INT_CHAR_REJING,
14   INT_MSGTRY_DC, INT_MSGTRY_TYPE2, INT_MSGTRY_V8, INT_MSGTRY_V5,
15   INT_MSGACK_DC, INT_MSGACK_SSL, INT_MSGACK_TYPE2, INT_MSGACK_V8, INT_MSGACK_V5,
16   INT_MSGDISPL, INT_MSGCOMP, INT_MSGNOCOMP, INT_MSGOFF
17 } int_msg_t;
18 
19 typedef struct {
20     const char *orig_data;
21     const char *msgtext;
22     const char *opt_text;
23     UDWORD port;
24     UDWORD bytes;
25     int_msg_t type;
26     status_t tstatus;
27 } fat_int_msg_t;
28 
29 typedef struct {
30     const char *orig_data;
31     char *msgtext;
32     const char *subj;
33     const char *url;
34     const char *tmp[6];
35     UDWORD type;
36     UDWORD origin;
37     UDWORD nativestatus;
38     UDWORD bytes;
39     UDWORD ref;
40     int otrencrypted:2;
41     int samehtml:1;
42 } fat_srv_msg_t;
43 
44 typedef int (cb_status)  (Contact *cont, parentmode_t pm, change_t ch, const char *text);
45 typedef int (cb_int_msg) (Contact *cont, parentmode_t pm, time_t stamp, fat_int_msg_t *msg);
46 typedef int (cb_srv_msg) (Contact *cont, parentmode_t pm, time_t stamp, fat_srv_msg_t *msg);
47 
48 void IMIntMsg    (Contact *cont, time_t stamp, status_t tstatus, int_msg_t type, const char *text);
49 void IMIntMsgMsg (Message *msg, time_t stamp, status_t tstatus);
50 void IMIntMsgFat (Contact *cont, time_t stamp, status_t tstatus, int_msg_t type, const char *text,
51                   const char *opt_text, UDWORD port, UDWORD bytes);
52 void IMSrvMsg    (Contact *cont, time_t stamp, UDWORD opt_origin, UDWORD opt_type, const char *text);
53 void IMSrvMsgFat (Contact *cont, time_t stamp, Opt *opt);
54 void IMOnline  (Contact *cont, status_t status, statusflag_t flags, UDWORD nativestatus, const char *text);
55 void IMOffline (Contact *cont);
56 
57 #define HIST_IN 1
58 #define HIST_OUT 2
59 
60 #endif /* CLIMM_IM_RESPONSE_H */
61