1 /** @page conversation-signals Conversation Signals
8 @signal receiving-im-msg
9 @signal received-im-msg
10 @signal blocked-im-msg
11 @signal writing-chat-msg
12 @signal wrote-chat-msg
13 @signal sending-chat-msg
15 @signal receiving-chat-msg
16 @signal received-chat-msg
17 @signal conversation-created
18 @signal conversation-updated
19 @signal deleting-conversation
21 @signal buddy-typing-stopped
22 @signal chat-buddy-joining
23 @signal chat-buddy-joined
24 @signal chat-buddy-flags
25 @signal chat-buddy-leaving
26 @signal chat-buddy-left
27 @signal chat-inviting-user
28 @signal chat-invited-user
30 @signal chat-invite-blocked
32 @signal chat-join-failed
34 @signal chat-topic-changed
35 @signal cleared-message-history
36 @signal conversation-extended-menu
37 @signal sent-attention
43 @signaldef writing-im-msg
45 gboolean (*writing_im_msg)(PurpleAccount *account, const char *who,
46 char **message, PurpleConversation *conv,
47 PurpleMessageFlags flags);
50 Emitted before a message is written in an IM conversation. If the
51 message is changed, then the changed message is displayed and logged
52 instead of the original message.
54 Make sure to free @a *message before you replace it!
55 @param account The account.
56 @param who The name of the user.
57 @param message A pointer to the message.
58 @param conv The conversation.
59 @param flags Flags for this message.
60 @return @c TRUE if the message should be canceled, or @c FALSE otherwise.
63 @signaldef wrote-im-msg
65 void (*wrote_im_msg)(PurpleAccount *account, const char *who,
66 char *message, PurpleConversation *conv,
67 PurpleMessageFlags flags);
70 Emitted after a message is written and possibly displayed in a conversation.
71 @param account The account.
72 @param who The name of the user.
73 @param message The message.
74 @param conv The conversation.
75 @param flags Flags for this message.
78 @signaldef sending-im-msg
80 void (*sending_im_msg)(PurpleAccount *account, const char *receiver,
84 Emitted before sending an IM to a user. @a message is a pointer to the
85 message string, so the plugin can replace the message before being sent.
87 Make sure to free @a *message before you replace it!
88 @param account The account the message is being sent on.
89 @param receiver The username of the receiver.
90 @param message A pointer to the outgoing message. This can be modified.
93 @signaldef sent-im-msg
95 void (*sent_im_msg)(PurpleAccount *account, const char *receiver,
99 Emitted after sending an IM to a user.
100 @param account The account the message was sent on.
101 @param receiver The username of the receiver.
102 @param message The message that was sent.
105 @signaldef receiving-im-msg
107 gboolean (*receiving_im_msg)(PurpleAccount *account, char **sender,
108 char **message, PurpleConversation *conv,
109 PurpleMessageFlags *flags);
112 Emitted when an IM is received. The callback can replace the name of the
113 sender, the message, or the flags by modifying the pointer to the
114 strings and integer. This can also be used to cancel a message by
117 Make sure to free @a *sender and @a *message before you replace them!
118 @return @c TRUE if the message should be canceled, or @c FALSE otherwise.
119 @param account The account the message was received on.
120 @param sender A pointer to the username of the sender.
121 @param message A pointer to the message that was sent.
122 @param conv The IM conversation.
123 @param flags A pointer to the IM message flags.
126 @signaldef received-im-msg
128 void (*received_im_msg)(PurpleAccount *account, char *sender, char *message,
129 PurpleConversation *conv, PurpleMessageFlags flags);
132 Emitted after an IM is received.
133 @param account The account the message was received on.
134 @param sender The username of the sender.
135 @param message The message that was sent.
136 @param conv The IM conversation.
137 @param flags The IM message flags.
140 @signaldef blocked-im-msg
142 void (*blocked_im_msg)(PurpleAccount *account, const char *sender,
143 const char *message, PurpleMessageFlags flags, time_t when);
146 Emitted after an IM is blocked due to privacy settings.
147 @param account The account the message was received on.
148 @param sender The username of the sender.
149 @param message The message that was blocked.
150 @param flags The IM message flags.
151 @param when The time the message was sent.
155 @signaldef writing-chat-msg
157 gboolean (*writing_chat_msg)(PurpleAccount *account, const char *who,
158 char **message, PurpleConversation *conv,
159 PurpleMessageFlags flags);
162 Emitted before a message is written in a chat conversation. If the
163 message is changed, then the changed message is displayed and logged
164 instead of the original message.
166 Make sure to free @a *message before you replace it!
167 @param account The account.
168 @param who The name of the user.
169 @param message A pointer to the message.
170 @param conv The conversation.
171 @param flags Flags for this message.
172 @return @c TRUE if the message should be canceled, or @c FALSE otherwise.
175 @signaldef wrote-chat-msg
177 void (*wrote_chat_msg)(PurpleAccount *account, const char *who,
178 char *message, PurpleConversation *conv,
179 PurpleMessageFlags flags);
182 Emitted after a message is written and possibly displayed in a chat.
183 @param account The account.
184 @param who The name of the user.
185 @param message The message.
186 @param conv The conversation.
187 @param flags Flags for this message.
190 @signaldef sending-chat-msg
192 void (*sending_chat_msg)(PurpleAccount *account, char **message, int id);
195 Emitted before sending a message to a chat. @a message is a pointer to the
196 message string, so the plugin can replace the message before being sent.
198 Make sure to free @a *message before you replace it!
199 @param account The account the message is being sent on.
200 @param message A pointer to the message that will be sent.
201 @param id The ID of the chat.
204 @signaldef sent-chat-msg
206 void (*sent_chat_msg)(PurpleAccount *account, const char *message, int id);
209 Emitted after sending a message to a chat.
210 @param account The account the message was sent on.
211 @param message The message that was sent.
212 @param id The ID of the chat.
215 @signaldef receiving-chat-msg
217 gboolean (*receiving_chat_msg)(PurpleAccount *account, char **sender,
218 char **message, PurpleConversation *conv, int *flags);
221 Emitted when a chat message is received. The callback can replace the
222 name of the sender, the message, or the flags by modifying the pointer to the
223 strings. This can also be used to cancel displaying a message by
226 Make sure to free @a *sender and @a *message before you replace them!
227 @return @c TRUE if the message should be canceled, or @c FALSE otherwise.
228 @param account The account the message was received on.
229 @param sender A pointer to the username of the sender.
230 @param message A pointer to the message that was sent.
231 @param conv The chat conversation.
232 @param flags A pointer to the chat message flags
235 @signaldef received-chat-msg
237 void (*received_chat_msg)(PurpleAccount *account, char *sender, char *message,
238 PurpleConversation *conv, PurpleMessageFlags flags);
241 Emitted after a chat message is received.
242 @param account The account the message was received on.
243 @param sender The username of the sender.
244 @param message The message that was sent.
245 @param conv The chat conversation.
246 @param flags The chat message flags.
249 @signaldef conversation-created
251 void (*conversation_created)(PurpleConversation *conv);
254 Emitted when a new conversation is created.
255 @param conv The new conversation.
258 @signaldef conversation-updated
260 void (*conversation_updated)(PurpleConversation *conv,
261 PurpleConvUpdateType type);
264 Emitted when a conversation is updated.
265 @param conv The conversation that was updated.
266 @param type The type of update that was made.
269 @signaldef deleting-conversation
271 void (*deleting_conversation)(PurpleConversation *conv);
274 Emitted just before a conversation is to be destroyed.
275 @param conv The conversation that's about to be destroyed.
278 @signaldef buddy-typing
280 void (*buddy_typing)(PurpleAccount *account, const char *name);
283 Emitted when a buddy starts typing in a conversation window.
284 @param account The account of the user which is typing.
285 @param name The name of the user which is typing.
288 @signaldef buddy-typing-stopped
290 void (*buddy_typing_stopped)(PurpleAccount *account, const char *name);
293 Emitted when a buddy stops typing in a conversation window.
294 @param account The account of the user which stopped typing.
295 @param name The name of the user which stopped typing.
298 @signaldef chat-buddy-joining
300 gboolean (*chat_buddy_joining)(PurpleConversation *conv, const char *name,
301 PurpleConvChatBuddyFlags flags);
304 Emitted when a buddy is joining a chat, before the list of
305 users in the chat updates to include the new user.
306 @return @c TRUE if the join should be hidden, or @c FALSE otherwise.
307 @param conv The chat conversation.
308 @param name The name of the user that is joining the conversation.
309 @param flags The flags of the user that is joining the conversation.
312 @signaldef chat-buddy-joined
314 void (*chat_buddy_joined)(PurpleConversation *conv, const char *name,
315 PurpleConvChatBuddyFlags flags,
316 gboolean new_arrival);
319 Emitted when a buddy joined a chat, after the users list is updated.
320 @param conv The chat conversation.
321 @param name The name of the user that has joined the conversation.
322 @param flags The flags of the user that has joined the conversation.
323 @param new_arrival If the buddy is a new arrival.
326 @signaldef chat-join-failed
328 void (*chat_join_failed)(PurpleConnection *gc, GHashTable *components);
331 Emitted when an account fails to join a chat room
332 @param gc The PurpleConnection of the account which failed to join the chat.
333 @param data The components passed to serv_join_chat() originally.
334 The hash function should be g_str_hash() and the equal
335 function should be g_str_equal().
338 @signaldef chat-buddy-flags
340 void (*chat_buddy_flags)(PurpleConversation *conv, const char *name,
341 PurpleConvChatBuddyFlags oldflags,
342 PurpleConvChatBuddyFlags newflags);
345 Emitted when a user in a chat changes flags.
346 @param conv The chat conversation.
347 @param name The name of the user.
348 @param oldflags The old flags.
349 @param newflags The new flags.
352 @signaldef chat-buddy-leaving
354 gboolean (*chat_buddy_leaving)(PurpleConversation *conv, const char *name,
358 Emitted when a user is leaving a chat, before the user list is updated.
359 This may include an optional reason why the user is leaving.
360 @return @c TRUE if the leave should be hidden, or @c FALSE otherwise.
361 @param conv The chat conversation.
362 @param name The name of the user that is leaving the chat.
363 @param reason The optional reason why the user is leaving.
366 @signaldef chat-buddy-left
368 void (*chat_buddy_left)(PurpleConversation *conv, const char *name,
372 Emitted when a user leaves a chat, after the user list is updated.
373 This may include an optional reason why the user is leaving.
374 @param conv The chat conversation.
375 @param name The name of the user that left the chat.
376 @param reason The optional reason why the user left the chat.
379 @signaldef chat-inviting-user
381 void (*chat_inviting_user)(PurpleConversation *conv, const char *name,
382 char **invite_message);
385 Emitted when a user is being invited to the chat. The callback can
386 replace the invite message to the invitee by modifying the pointer to
389 Make sure to free @a *invite_message before you replace it!
390 @param conv The chat conversation.
391 @param name The name of the user being invited.
392 @param invite_message A pointer to the reason why a user is being
396 @signaldef chat-invited-user
398 void (*chat_invited_user)(PurpleConversation *conv, const char *name,
399 const char *invite_message);
402 Emitted when a user invited another user to a chat.
403 @param conv The chat conversation.
404 @param conv The name of the user that was invited.
405 @param invite_message The message to be sent to the user when invited.
408 @signaldef chat-invited
410 gint (*chat_invited)(PurpleAccount *account, const char *inviter,
411 const char *chat, const char *invite_message
412 const GHashTable *components);
415 Emitted when an account was invited to a chat.
416 @param account The account being invited.
417 @param inviter The username of the person inviting the account.
418 @param chat The name of the chat you're being invited to.
419 @param invite_message The optional invite message.
420 @param components The components necessary if you want to call
422 @return Less than zero if the invitation should be rejected, greater than
423 zero if the invitation should be accepted. If zero is returned, the
424 default behavior will be maintained: the user will be prompted.
427 @signaldef chat-invite-blocked
429 void (*chat_invite_blocked)(PurpleAccount *account, const char *inviter,
430 const char *name, const char *message, GHashTable *data);
433 Emitted when an invitation to join a chat is blocked.
434 @param account The account the invitation was sent to.
435 @param inviter The name of the person sending the invitation.
436 @param name The name of the chat invited to.
437 @param message The invitation message sent.
438 @param data Hashtable containing data about the invited chat.
442 @signaldef chat-joined
444 void (*chat_joined)(PurpleConversation *conv);
447 Emitted when an account joins a chat room.
448 @param conv The conversation that joined the chat room.
453 void (*chat_left)(PurpleConversation *conv);
456 Emitted when an account leaves a chat room.
457 @param conv The conversation that left the chat room.
460 @signaldef chat-topic-changed
462 void (*chat_topic_changed)(PurpleConversation *conv, const char *who, const char *topic);
465 Emitted when the topic is changed in a chat.
466 @param conv The conversation whose topic changed.
467 @param who The name of the person that changed the topic.
468 @param topic The new topic.
471 @signaldef conversation-extended-menu
473 void (*conversation_extended_menu)(PurpleConversation *conv, GList **list);
476 Emitted when the UI requests a list of plugin actions for a
478 @param conv The conversation.
479 @param list A pointer to the list of actions.
483 @signaldef cleared-message-history
485 void (*cleared_message_history)(PurpleConversation *conv);
488 Emitted when the conversation history is cleared.
489 @param conv The conversation.
493 @signaldef sent-attention
495 void (*got_attention)(PurpleAccount *account, const char *who,
496 PurpleConversation *conv, guint type)
499 Emitted when receiving an attention message (buzz, nudge, etc.).
500 @param account The account
501 @param who The name of the person receiving the attention
502 @param conv The conversation
503 @param type The attention type (an index starting at 0)
507 @signaldef got-attention
509 void (*got_attention)(PurpleAccount *account, const char *who,
510 PurpleConversation *conv, guint type)
513 Emitted when receiving an attention message (buzz, nudge, etc.).
514 @param account The account
515 @param who The name of the person sending the attention
516 @param conv The conversation
517 @param type The attention type (an index starting at 0)
521 // vim: syntax=c.doxygen tw=75 et