about summary refs log tree commit diff stats
path: root/apidocs/c/profhooks.h
blob: 039abacc616de39aff4634d88054df9ecdf69cbd (plain) (blame)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/** @file
C Hooks.
*/

/**
Called when profanity loads the plugin
@param version The version of profanity as a string e.g. "0.5.0"
@param status The build status, either "development" or "release"
*/
void prof_init(const char * const version, const char * const status);

/**
Called when profanity starts, after {@link prof_init}
*/
void prof_on_start(void);

/**
Called when profanity shuts down
*/
void prof_on_shutdown(void);

/**
Called when an account is connected
@param account_name The name of the account
@param fulljid The full JID of the account
*/
void prof_on_connect(const char * const account_name, const char * const fulljid);

/**
Called when an account is disconnected
@param account_name The name of the account
@param fulljid The full JID of the account
*/
void prof_on_disconnect(const char * const account_name, const char * const fulljid);

/**
Called before a regular chat message is displayed
@param jid The JID of the sender
@param message The message received
@return The new message, or NULL if no change made to the message
*/
char* prof_pre_chat_message_display(const char * const jid, const char *message);

/**
Called after a regular chat message is displayed
@param jid The JID of the sender
@param message The message received
*/
void prof_post_chat_message_display(const char * const jid, const char *message);

/**
Called before a regular chat message is sent
@param jid The JID of the recipient
@param message The message to send
@return The new message, or NULL if no change made to the message
*/
char* prof_pre_chat_message_send(const char * const jid, const char *message);

/**
Called after a regular chat message is sent
@param jid The JID of the recipient
@param message The message sent
*/
void prof_post_chat_message_send(const char * const jid, const char *message);

/**
Called before a MUC message is displayed
@param room The JID of the room
@param nick The nickname of the sender
@param message The message received
@return The new message, or NULL if no change made to the message
*/
char* prof_pre_room_message_display(const char * const room, const char * const nick, const char *message);

/**
Called after a MUC message is displayed
@param room The JID of the room
@param nick The nickname of the sender
@param message The message received
*/
void prof_post_room_message_display(const char * const room, const char * const nick, const char *message);

/**
Called before a MUC message is sent
@param room The JID of the room
@param message The message to send
@return The new message, or NULL if no change made to the message
*/
char* prof_pre_room_message_send(const char * const room, const char *message);

/**
Called after a MUC message is sent
@param room The JID of the room
@param message The message sent
*/
void prof_post_room_message_send(const char * const room, const char *message);

/**
Called before a MUC private message is displayed
@param room The JID of the room
@param nick The nickname of the sender
@param message The message received
@return The new message, or NULL if no change made to the message
*/
char* prof_pre_priv_message_display(const char * const room, const char * const nick, const char *message);

/**
Called after a MUC private message is displayed
@param room The JID of the room
@param nick The nickname of the sender
@param message The message received
*/
void prof_post_priv_message_display(const char * const room, const char * const nick, const char *message);

/**
Called before a MUC private message is sent
@param room The JID of the room
@param nick The nickname of the recipient
@param message The message to send
@return The new message, or NULL if no change made to the message
*/
char* prof_pre_priv_message_send(const char * const room, const char * const nick, const char *message);

/**
Called after a MUC private message is sent
@param room The JID of the room
@param nick The nickname of the recipient
@param message The message sent
*/
void prof_post_priv_message_send(const char * const room, const char * const nick, const char *message);