author | Mikael Berthe <mikael@lilotux.net> |
Sun, 25 Oct 2009 23:25:14 +0100 | |
changeset 1639 | d9913c1b35e7 |
parent 1623 | b008ac166b91 |
child 1658 | c3d0cb4dc9d4 |
permissions | -rw-r--r-- |
113 | 1 |
#ifndef __HOOKS_H__ |
2 |
#define __HOOKS_H__ 1 |
|
3 |
||
4 |
#include <time.h> |
|
1598 | 5 |
#include <loudmouth/loudmouth.h> |
6 |
#include "xmpp.h" |
|
113 | 7 |
|
1484
7b36b91a4388
New UI message flag (O) when OTR is used
Mikael Berthe <mikael@lilotux.net>
parents:
1425
diff
changeset
|
8 |
// These two defines are used by hk_message_{in,out} arguments |
7b36b91a4388
New UI message flag (O) when OTR is used
Mikael Berthe <mikael@lilotux.net>
parents:
1425
diff
changeset
|
9 |
#define ENCRYPTED_PGP 1 |
7b36b91a4388
New UI message flag (O) when OTR is used
Mikael Berthe <mikael@lilotux.net>
parents:
1425
diff
changeset
|
10 |
#define ENCRYPTED_OTR 2 |
113 | 11 |
|
1607 | 12 |
#include "config.h" |
13 |
#ifdef MODULES_ENABLE |
|
14 |
#include <glib.h> |
|
15 |
||
1623
b008ac166b91
Flags for hook handlers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1607
diff
changeset
|
16 |
#define HOOK_MESSAGE_IN ( 0x00000001 ) |
b008ac166b91
Flags for hook handlers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1607
diff
changeset
|
17 |
#define HOOK_MESSAGE_OUT ( 0x00000002 ) |
b008ac166b91
Flags for hook handlers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1607
diff
changeset
|
18 |
#define HOOK_STATUS_CHANGE ( 0x00000004 ) |
b008ac166b91
Flags for hook handlers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1607
diff
changeset
|
19 |
#define HOOK_MY_STATUS_CHANGE ( 0x00000008 ) |
b008ac166b91
Flags for hook handlers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1607
diff
changeset
|
20 |
#define HOOK_INTERNAL ( 0x00000010 ) |
b008ac166b91
Flags for hook handlers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1607
diff
changeset
|
21 |
|
1607 | 22 |
typedef struct { |
23 |
const char *name; |
|
24 |
const char *value; |
|
25 |
} hk_arg_t; |
|
26 |
||
1623
b008ac166b91
Flags for hook handlers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1607
diff
changeset
|
27 |
typedef void (*hk_handler_t) (guint32 flags, hk_arg_t *args, gpointer userdata); |
1607 | 28 |
|
1623
b008ac166b91
Flags for hook handlers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1607
diff
changeset
|
29 |
void hk_add_handler (hk_handler_t handler, guint32 flags, gpointer userdata); |
1607 | 30 |
void hk_del_handler (hk_handler_t handler, gpointer userdata); |
31 |
#endif |
|
32 |
||
1425 | 33 |
void hk_mainloop(void); |
1398
f8321420ed7a
Remove useless inline's
Mikael Berthe <mikael@lilotux.net>
parents:
1352
diff
changeset
|
34 |
void hk_message_in(const char *bjid, const char *resname, |
1598 | 35 |
time_t timestamp, const char *msg, LmMessageSubType type, |
36 |
guint encrypted); |
|
1398
f8321420ed7a
Remove useless inline's
Mikael Berthe <mikael@lilotux.net>
parents:
1352
diff
changeset
|
37 |
void hk_message_out(const char *bjid, const char *nickname, |
1602 | 38 |
time_t timestamp, const char *msg, |
39 |
guint encrypted, gpointer xep184); |
|
1398
f8321420ed7a
Remove useless inline's
Mikael Berthe <mikael@lilotux.net>
parents:
1352
diff
changeset
|
40 |
void hk_statuschange(const char *bjid, const char *resname, gchar prio, |
1598 | 41 |
time_t timestamp, enum imstatus status, |
42 |
char const *status_msg); |
|
1398
f8321420ed7a
Remove useless inline's
Mikael Berthe <mikael@lilotux.net>
parents:
1352
diff
changeset
|
43 |
void hk_mystatuschange(time_t timestamp, |
438
b44be19d6229
Handle multiple resources for the same buddy
Mikael Berthe <mikael@lilotux.net>
parents:
393
diff
changeset
|
44 |
enum imstatus old_status, |
b44be19d6229
Handle multiple resources for the same buddy
Mikael Berthe <mikael@lilotux.net>
parents:
393
diff
changeset
|
45 |
enum imstatus new_status, const char *msg); |
113 | 46 |
|
1352
61a54e172010
Add internal hooks support
Mikael Berthe <mikael@lilotux.net>
parents:
1058
diff
changeset
|
47 |
void hook_execute_internal(const char *hookname); |
61a54e172010
Add internal hooks support
Mikael Berthe <mikael@lilotux.net>
parents:
1058
diff
changeset
|
48 |
|
281
f562b9af2de7
Add "const" specifier in prototypes
Mikael Berthe <mikael@lilotux.net>
parents:
221
diff
changeset
|
49 |
void hk_ext_cmd_init(const char *command); |
1058 | 50 |
void hk_ext_cmd(const char *bjid, guchar type, guchar info, const char *data); |
160 | 51 |
|
113 | 52 |
#endif /* __HOOKS_H__ */ |
576 | 53 |
|
580 | 54 |
/* vim: set expandtab cindent cinoptions=>2\:2(0: For Vim users... */ |