doc/reference/pidgin/signals_gtkconv.md

Mon, 04 Apr 2022 23:56:44 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Mon, 04 Apr 2022 23:56:44 -0500
changeset 41321
97b0dbc1873f
parent 41124
95555046173e
child 42267
fdd35a822758
permissions
-rw-r--r--

Remove PidginContactCompletion for now as it's barely used and not GTK4 compatible.

I created PIDGIN-17606 to reimplement this in a better way and to use it in the
new instant message dialog as well as the invite to chat dialog.

Testing Done:
Compiled and ran.

Reviewed at https://reviews.imfreedom.org/r/1378/

Title: Conversation Signals
Slug: conversation-signals

## Conversation signals

### displaying-im-msg

```c
gboolean
user_function(PurpleAccount *account,
              const gchar *who,
              gchar **message,
              PurpleConversation *conv,
              PurpleMessageFlags flags,
              gpointer user_data);
```

Emitted just before a message is displayed in an IM conversation. `message` is
a pointer to a string, so the plugin can replace the message that will be
displayed. This can also be used to cancel displaying a message by returning
`TRUE`.

> **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.

**user_data**
: User data set when the signal handler was connected.

**Returns:**

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

## displayed-im-msg

```c
void
user_function(PurpleAccount *account,
              const gchar *who,
              gchar *message,
              PurpleConversation *conv,
              PurpleMessageFlags flags,
              gpointer user_data);
```

Emitted after a message is displayed in an IM conversation.

**Parameters:**

**account**
: The account.

**who**
: The name of the user.

**message**
: The message.

**conv**
: The conversation.

**flags**
: Flags for this message.

**user_data**
: User data set when the signal handler was connected.

### displaying-chat-msg

```c
gboolean
user_function(PurpleAccount *account,
              const gchar *who,
              gchar **message,
              PurpleConversation *conv,
              PurpleMessageFlags flags,
              gpointer user_data);
```

Emitted just before a message is displayed in a chat. `message` is a pointer to
a string, so the plugin can replace the message that will be displayed. This
can also be used to cancel displaying a message by returning `TRUE`.

> **NOTE:** Make sure to free `*message` before you replace it!

**Parameters:**

**account**
: The account the message is being displayed and sent on.

**who**
: The name of the user.

**message**
: A pointer to the message that will be displayed and sent.

**conv**
: The conversation the message is being displayed and sent on.

**flags**
: Flags for this message.

**user_data**
: User data set when the signal handler was connected.

**Returns:**

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

### displayed-chat-msg

```c
void
user_function(PurpleAccount *account,
              const gchar *who,
              gchar *message,
              PurpleConversation *conv,
              PurpleMessageFlags flags,
              gpointer user_data);
```

Emitted after a message is displayed in a chat conversation.

**Parameters:**

**account**
: The account the message is being displayed and sent on.

**who**
: The name of the user.

**message**
: A pointer to the message that will be displayed and sent.

**conv**
: The conversation the message is being displayed and sent on.

**flags**
: Flags for this message.

**user_data**
: User data set when the signal handler was connected.

### conversation-switched

```c
void user_function(PurpleConversation *conv, gpointer user_data);
```

Emitted when a window switched from one conversation to another.

**Parameters:**

**new_conv**
: The now active conversation.

**user_data**
: User data set when the signal handler was connected.

### conversation-displayed

```c
void user_function(PidginConversation *gtkconv, gpointer user_data);
```

Emitted right after the Pidgin UI is attached to a new conversation.

**Parameters:**

**gtkconv**
: The PidginConversation.

**user_data**
: User data set when the signal handler was connected.

mercurial