Conversation Signals

Signals:

- writing-im-msg
- wrote-im-msg
- sending-im-msg
- sent-im-msg
- receiving-im-msg
- received-im-msg
- blocked-im-msg
- writing-chat-msg
- wrote-chat-msg
- sending-chat-msg
- sent-chat-msg
- receiving-chat-msg
- received-chat-msg
- conversation-created
- conversation-updated
- deleting-conversation
- buddy-typing
- buddy-typing-stopped
- chat-buddy-joining
- chat-buddy-joined
- chat-buddy-flags
- chat-buddy-leaving
- chat-buddy-left
- chat-inviting-user
- chat-invited-user
- chat-invited
- chat-invite-blocked
- chat-joined
- chat-join-failed
- chat-left
- chat-topic-changed
- cleared-message-history
- conversation-extended-menu
- sent-attention
- got-attention

See also
  conversation.h

# writing-im-msg

gboolean (*writing_im_msg)(PurpleAccount *account, const char *who,
char **message, PurpleConversation *conv,
PurpleMessageFlags flags);

Description:
  Emitted before a message is written in an IM conversation. If the message is changed, then the changed message is displayed and logged instead of the original message.

Note
  Make sure to free *message before you replace it!

Parameters

  account | The account.
  who | The name of the user.
  message | A pointer to the message.
  conv | The conversation.
  flags | Flags for this message.

Returns
  `TRUE` if the message should be canceled, or `FALSE` otherwise.

# wrote-im-msg

void (*wrote_im_msg)(PurpleAccount *account, const char *who,
char *message, PurpleConversation *conv,
PurpleMessageFlags flags);

Description:
  Emitted after a message is written and possibly displayed in a conversation.

Parameters

  account | The account.
  who | The name of the user.
  message | The message.
  conv | The conversation.
  flags | Flags for this message.

# sending-im-msg

void (*sending_im_msg)(PurpleAccount *account, const char *receiver,
char **message);

Description:
  Emitted before sending an IM to a user. message is a pointer to the message string, so the plugin can replace the message before being sent.

Note
  Make sure to free *message before you replace it!

Parameters

  account | The account the message is being sent on.
  receiver | The username of the receiver.
  message | A pointer to the outgoing message. This can be modified.

# sent-im-msg

void (*sent_im_msg)(PurpleAccount *account, const char *receiver,
const char *message);

Description:
  Emitted after sending an IM to a user.

Parameters

  account | The account the message was sent on.
  receiver | The username of the receiver.
  message | The message that was sent.

# receiving-im-msg

gboolean (*receiving_im_msg)(PurpleAccount *account, char **sender,
char **message, PurpleConversation *conv,
PurpleMessageFlags *flags);

Description:
  Emitted when an IM is received. The callback can replace the name of the sender, the message, or the flags by modifying the pointer to the strings and integer. This can also be used to cancel a message by returning `TRUE`.

Note
  Make sure to free *sender and *message before you replace them!

Returns
  `TRUE` if the message should be canceled, or `FALSE` otherwise.

Parameters

  account | The account the message was received on.
  sender | A pointer to the username of the sender.
  message | A pointer to the message that was sent.
  conv | The IM conversation.
  flags | A pointer to the IM message flags.

# received-im-msg

void (*received_im_msg)(PurpleAccount *account, char *sender, char *message,
PurpleConversation *conv, PurpleMessageFlags flags);

Description:
  Emitted after an IM is received.

Parameters

  account | The account the message was received on.
  sender | The username of the sender.
  message | The message that was sent.
  conv | The IM conversation.
  flags | The IM message flags.

# blocked-im-msg

void (*blocked_im_msg)(PurpleAccount *account, const char *sender,
const char *message, PurpleMessageFlags flags, time_t when);

Description:
  Emitted after an IM is blocked due to privacy settings.

Parameters

  account | The account the message was received on.
  sender | The username of the sender.
  message | The message that was blocked.
  flags | The IM message flags.
  when | The time the message was sent.

Since
  2.5.0

# writing-chat-msg

gboolean (*writing_chat_msg)(PurpleAccount *account, const char *who,
char **message, PurpleConversation *conv,
PurpleMessageFlags flags);

Description:
  Emitted before a message is written in a chat conversation. If the message is changed, then the changed message is displayed and logged instead of the original message.

Note
  Make sure to free *message before you replace it!

Parameters

  account | The account.
  who | The name of the user.
  message | A pointer to the message.
  conv | The conversation.
  flags | Flags for this message.

Returns
  `TRUE` if the message should be canceled, or `FALSE` otherwise.

# wrote-chat-msg

void (*wrote_chat_msg)(PurpleAccount *account, const char *who,
char *message, PurpleConversation *conv,
PurpleMessageFlags flags);

Description:
  Emitted after a message is written and possibly displayed in a chat.

Parameters

  account | The account.
  who | The name of the user.
  message | The message.
  conv | The conversation.
  flags | Flags for this message.

# sending-chat-msg

void (*sending_chat_msg)(PurpleAccount *account, char **message, int id);

Description:
  Emitted before sending a message to a chat. message is a pointer to the message string, so the plugin can replace the message before being sent.

Note
  Make sure to free *message before you replace it!

Parameters

  account | The account the message is being sent on.
  message | A pointer to the message that will be sent.
  id | The ID of the chat.

# sent-chat-msg

void (*sent_chat_msg)(PurpleAccount *account, const char *message, int id);

Description:
  Emitted after sending a message to a chat.

Parameters

  account | The account the message was sent on.
  message | The message that was sent.
  id | The ID of the chat.

# receiving-chat-msg

gboolean (*receiving_chat_msg)(PurpleAccount *account, char **sender,
char **message, PurpleConversation *conv, int *flags);

Description:
  Emitted when a chat message is received. The callback can replace the name of the sender, the message, or the flags by modifying the pointer to the strings. This can also be used to cancel displaying a message by returning `TRUE`.

Note
  Make sure to free *sender and *message before you replace them!

Returns
  `TRUE` if the message should be canceled, or `FALSE` otherwise.

Parameters

  account | The account the message was received on.
  sender | A pointer to the username of the sender.
  message | A pointer to the message that was sent.
  conv | The chat conversation.
  flags | A pointer to the chat message flags

# received-chat-msg

void (*received_chat_msg)(PurpleAccount *account, char *sender, char *message,
PurpleConversation *conv, PurpleMessageFlags flags);

Description:
  Emitted after a chat message is received.

Parameters

  account | The account the message was received on.
  sender | The username of the sender.
  message | The message that was sent.
  conv | The chat conversation.
  flags | The chat message flags.

# conversation-created

void (*conversation_created)(PurpleConversation *conv);

Description:
  Emitted when a new conversation is created.

Parameters

  conv | The new conversation.

# conversation-updated

void (*conversation_updated)(PurpleConversation *conv,
PurpleConvUpdateType type);

Description:
  Emitted when a conversation is updated.

Parameters

  conv | The conversation that was updated.
  type | The type of update that was made.

# deleting-conversation

void (*deleting_conversation)(PurpleConversation *conv);

Description:
  Emitted just before a conversation is to be destroyed.

Parameters

  conv | The conversation that's about to be destroyed.

# buddy-typing

void (*buddy_typing)(PurpleAccount *account, const char *name);

Description:
  Emitted when a buddy starts typing in a conversation window.

Parameters

  account | The account of the user which is typing.
  name | The name of the user which is typing.

# buddy-typing-stopped

void (*buddy_typing_stopped)(PurpleAccount *account, const char *name);

Description:
  Emitted when a buddy stops typing in a conversation window.

Parameters

  account | The account of the user which stopped typing.
  name | The name of the user which stopped typing.

# chat-buddy-joining

gboolean (*chat_buddy_joining)(PurpleConversation *conv, const char *name,
PurpleConvChatBuddyFlags flags);

Description:
  Emitted when a buddy is joining a chat, before the list of users in the chat updates to include the new user.

Returns
  `TRUE` if the join should be hidden, or `FALSE` otherwise.

Parameters

  conv | The chat conversation.
  name | The name of the user that is joining the conversation.
  flags | The flags of the user that is joining the conversation.

# chat-buddy-joined

void (*chat_buddy_joined)(PurpleConversation *conv, const char *name,
PurpleConvChatBuddyFlags flags,
gboolean new_arrival);

Description:
  Emitted when a buddy joined a chat, after the users list is updated.

Parameters

  conv | The chat conversation.
  name | The name of the user that has joined the conversation.
  flags | The flags of the user that has joined the conversation.
  new_arrival | If the buddy is a new arrival.

# chat-join-failed

void (*chat_join_failed)(PurpleConnection *gc, GHashTable *components);

Description:
  Emitted when an account fails to join a chat room

Parameters

  gc | The PurpleConnection of the account which failed to join the chat.
  data | The components passed to serv_join_chat() originally. The hash function should be g_str_hash() and the equal function should be g_str_equal().

# chat-buddy-flags

void (*chat_buddy_flags)(PurpleConversation *conv, const char *name,
PurpleConvChatBuddyFlags oldflags,
PurpleConvChatBuddyFlags newflags);

Description:
  Emitted when a user in a chat changes flags.

Parameters

  conv | The chat conversation.
  name | The name of the user.
  oldflags | The old flags.
  newflags | The new flags.

# chat-buddy-leaving

gboolean (*chat_buddy_leaving)(PurpleConversation *conv, const char *name,
const char *reason);

Description:
  Emitted when a user is leaving a chat, before the user list is updated. This may include an optional reason why the user is leaving.

Returns
  `TRUE` if the leave should be hidden, or `FALSE` otherwise.

Parameters

  conv | The chat conversation.
  name | The name of the user that is leaving the chat.
  reason | The optional reason why the user is leaving.

# chat-buddy-left

void (*chat_buddy_left)(PurpleConversation *conv, const char *name,
const char *reason);

Description:
  Emitted when a user leaves a chat, after the user list is updated. This may include an optional reason why the user is leaving.

Parameters

  conv | The chat conversation.
  name | The name of the user that left the chat.
  reason | The optional reason why the user left the chat.

# chat-inviting-user

void (*chat_inviting_user)(PurpleConversation *conv, const char *name,
char **invite_message);

Description:
  Emitted when a user is being invited to the chat. The callback can replace the invite message to the invitee by modifying the pointer to the invite message.

Note
  Make sure to free *invite_message before you replace it!

Parameters

  conv | The chat conversation.
  name | The name of the user being invited.
  invite_message | A pointer to the reason why a user is being invited.

# chat-invited-user

void (*chat_invited_user)(PurpleConversation *conv, const char *name,
const char *invite_message);

Description:
  Emitted when a user invited another user to a chat.

Parameters

  conv | The chat conversation.
  conv | The name of the user that was invited.
  invite_message | The message to be sent to the user when invited.

# chat-invited

gint (*chat_invited)(PurpleAccount *account, const char *inviter,
const char *chat, const char *invite_message
const GHashTable *components);

Description:
  Emitted when an account was invited to a chat.

Parameters

  account | The account being invited.
  inviter | The username of the person inviting the account.
  chat | The name of the chat you're being invited to.
  invite_message | The optional invite message.
  components | The components necessary if you want to call serv_join_chat()

Returns
  Less than zero if the invitation should be rejected, greater than zero if the invitation should be accepted. If zero is returned, the default behavior will be maintained: the user will be prompted.

# chat-invite-blocked

void (*chat_invite_blocked)(PurpleAccount *account, const char *inviter,
const char *name, const char *message, GHashTable *data);

Description:
  Emitted when an invitation to join a chat is blocked.

Parameters

  account | The account the invitation was sent to.
  inviter | The name of the person sending the invitation.
  name | The name of the chat invited to.
  message | The invitation message sent.
  data | Hashtable containing data about the invited chat.

Since
  2.5.0

# chat-joined

void (*chat_joined)(PurpleConversation *conv);

Description:
  Emitted when an account joins a chat room.

Parameters

  conv | The conversation that joined the chat room.

# chat-left

void (*chat_left)(PurpleConversation *conv);

Description:
  Emitted when an account leaves a chat room.

Parameters

  conv | The conversation that left the chat room.

# chat-topic-changed

void (*chat_topic_changed)(PurpleConversation *conv, const char *who, const char *topic);

Description:
  Emitted when the topic is changed in a chat.

Parameters

  conv | The conversation whose topic changed.
  who | The name of the person that changed the topic.
  topic | The new topic.

# conversation-extended-menu

void (*conversation_extended_menu)(PurpleConversation *conv, GList **list);

Description:
  Emitted when the UI requests a list of plugin actions for a conversation.

Parameters

  conv | The conversation.
  list | A pointer to the list of actions.

Since
  2.1.0

# cleared-message-history

void (*cleared_message_history)(PurpleConversation *conv);

Description:
  Emitted when the conversation history is cleared.

Parameters

  conv | The conversation.

Since
  2.8.0

# sent-attention

void (*got_attention)(PurpleAccount *account, const char *who,
PurpleConversation *conv, guint type)

Description:
  Emitted when receiving an attention message (buzz, nudge, etc.).

Parameters

  account | The account
  who | The name of the person receiving the attention
  conv | The conversation
  type | The attention type (an index starting at 0)

Since
  2.7.0

# got-attention

void (*got_attention)(PurpleAccount *account, const char *who,
PurpleConversation *conv, guint type)

Description:
  Emitted when receiving an attention message (buzz, nudge, etc.).

Parameters

  account | The account
  who | The name of the person sending the attention
  conv | The conversation
  type | The attention type (an index starting at 0)

Since
  2.7.0