doc/reference/pidgin/signals_gtkconv.md

Fri, 31 Dec 2021 03:34:12 -0600

author
Elliott Sales de Andrade <quantum.analyst@gmail.com>
date
Fri, 31 Dec 2021 03:34:12 -0600
changeset 41232
3e534f0345b0
parent 41124
95555046173e
child 42267
fdd35a822758
permissions
-rw-r--r--

Replace g_time_zone_new by g_time_zone_new_identifier

The former calls the latter with a fallback to UTC, but is deprecated, so we're going to do the same for now (though maybe we should fall back to our normal `tz == NULL` handling?)

Testing Done:
Compiled.

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

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