author | Mikael Berthe <mikael@lilotux.net> |
Sun, 21 Mar 2010 15:22:48 +0100 | |
changeset 1806 | 9daf6b3f30d6 |
parent 1797 | 246c5d359c97 |
child 1811 | e6d355e50d7a |
permissions | -rw-r--r-- |
1668
41c26b7d2890
Install mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1658
diff
changeset
|
1 |
#ifndef __MCABBER_HOOKS_H__ |
41c26b7d2890
Install mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1658
diff
changeset
|
2 |
#define __MCABBER_HOOKS_H__ 1 |
113 | 3 |
|
4 |
#include <time.h> |
|
1598 | 5 |
#include <loudmouth/loudmouth.h> |
1668
41c26b7d2890
Install mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1658
diff
changeset
|
6 |
#include <mcabber/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 |
|
1668
41c26b7d2890
Install mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1658
diff
changeset
|
12 |
#include <mcabber/config.h> |
1607 | 13 |
#ifdef MODULES_ENABLE |
14 |
#include <glib.h> |
|
15 |
||
1795 | 16 |
// Core hooks |
1797
246c5d359c97
Add "hook-pre-message-in" hook
Mikael Berthe <mikael@lilotux.net>
parents:
1796
diff
changeset
|
17 |
#define HOOK_PRE_MESSAGE_IN "hook-pre-message-in" |
1796
5e2db25fdb17
Rename "hook-message-in" to "hook-post-message-in"
Mikael Berthe <mikael@lilotux.net>
parents:
1795
diff
changeset
|
18 |
#define HOOK_POST_MESSAGE_IN "hook-post-message-in" |
1795 | 19 |
#define HOOK_MESSAGE_OUT "hook-message-out" |
20 |
#define HOOK_STATUS_CHANGE "hook-status-change" |
|
21 |
#define HOOK_MY_STATUS_CHANGE "hook-my-status-change" |
|
22 |
#define HOOK_POST_CONNECT "hook-post-connect" |
|
23 |
#define HOOK_PRE_DISCONNECT "hook-pre-disconnect" |
|
1806
9daf6b3f30d6
Add hook-unread-list-change
Mikael Berthe <mikael@lilotux.net>
parents:
1797
diff
changeset
|
24 |
#define HOOK_UNREAD_LIST_CHANGE "hook-unread-list-change" |
1795 | 25 |
|
26 |
typedef enum { |
|
27 |
HOOK_HANDLER_RESULT_ALLOW_MORE_HOOKS = 0, |
|
28 |
HOOK_HANDLER_RESULT_NO_MORE_HOOK, |
|
29 |
HOOK_HANDLER_RESULT_NO_MORE_HOOK_DROP_DATA, |
|
30 |
} hk_handler_result; |
|
1623
b008ac166b91
Flags for hook handlers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1607
diff
changeset
|
31 |
|
1607 | 32 |
typedef struct { |
33 |
const char *name; |
|
34 |
const char *value; |
|
35 |
} hk_arg_t; |
|
36 |
||
1795 | 37 |
typedef guint (*hk_handler_t) (const gchar *hookname, hk_arg_t *args, |
38 |
gpointer userdata); |
|
1607 | 39 |
|
1795 | 40 |
guint hk_add_handler(hk_handler_t handler, const gchar *hookname, |
41 |
gint priority, gpointer userdata); |
|
42 |
void hk_del_handler(const gchar *hookname, guint hid); |
|
43 |
guint hk_run_handlers(const gchar *hookname, hk_arg_t *args); |
|
1607 | 44 |
#endif |
45 |
||
1398
f8321420ed7a
Remove useless inline's
Mikael Berthe <mikael@lilotux.net>
parents:
1352
diff
changeset
|
46 |
void hk_message_in(const char *bjid, const char *resname, |
1598 | 47 |
time_t timestamp, const char *msg, LmMessageSubType type, |
48 |
guint encrypted); |
|
1398
f8321420ed7a
Remove useless inline's
Mikael Berthe <mikael@lilotux.net>
parents:
1352
diff
changeset
|
49 |
void hk_message_out(const char *bjid, const char *nickname, |
1602 | 50 |
time_t timestamp, const char *msg, |
51 |
guint encrypted, gpointer xep184); |
|
1398
f8321420ed7a
Remove useless inline's
Mikael Berthe <mikael@lilotux.net>
parents:
1352
diff
changeset
|
52 |
void hk_statuschange(const char *bjid, const char *resname, gchar prio, |
1598 | 53 |
time_t timestamp, enum imstatus status, |
54 |
char const *status_msg); |
|
1398
f8321420ed7a
Remove useless inline's
Mikael Berthe <mikael@lilotux.net>
parents:
1352
diff
changeset
|
55 |
void hk_mystatuschange(time_t timestamp, |
1784
250ad919f03f
Small code cleanup in hooks.[ch]
Mikael Berthe <mikael@lilotux.net>
parents:
1683
diff
changeset
|
56 |
enum imstatus old_status, enum imstatus new_status, |
250ad919f03f
Small code cleanup in hooks.[ch]
Mikael Berthe <mikael@lilotux.net>
parents:
1683
diff
changeset
|
57 |
const char *msg); |
113 | 58 |
|
1683
b09f82f61745
Split HOOK_INTERNAL
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1668
diff
changeset
|
59 |
void hk_postconnect(void); |
b09f82f61745
Split HOOK_INTERNAL
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1668
diff
changeset
|
60 |
void hk_predisconnect(void); |
1352
61a54e172010
Add internal hooks support
Mikael Berthe <mikael@lilotux.net>
parents:
1058
diff
changeset
|
61 |
|
281
f562b9af2de7
Add "const" specifier in prototypes
Mikael Berthe <mikael@lilotux.net>
parents:
221
diff
changeset
|
62 |
void hk_ext_cmd_init(const char *command); |
1058 | 63 |
void hk_ext_cmd(const char *bjid, guchar type, guchar info, const char *data); |
160 | 64 |
|
1668
41c26b7d2890
Install mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1658
diff
changeset
|
65 |
#endif /* __MCABBER_HOOKS_H__ */ |
576 | 66 |
|
580 | 67 |
/* vim: set expandtab cindent cinoptions=>2\:2(0: For Vim users... */ |