summaryrefslogtreecommitdiff
path: root/doc/reference/libpurple/signals_connection.md
blob: 552dd425b6ee232843e4246cf35f8099552370e3 (plain)
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
Title: Connection Signals
Slug: connection-signals

## Connection Signals

### Signal List

* [online](#online)
* [offline](#offline)
* [signing-on](#signing-on)
* [signed-on](#signed-on)
* [autojoin](#autojoin)
* [signing-off](#signing-off)
* [signed-off](#signed-off)
* [connection-error](#connection-error)

### Signal Details

#### online

```c
void user_function(gpointer user_data);
```

Emitted when the first connection has connected when all connections were
previously not connected.

**Parameters:**

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

----

#### offline

```c
void user_function(gpointer user_data);
```

Emitted when the last connected connection has disconnected.


**Parameters:**

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

----

#### signing-on

```c
void user_function(PurpleConnection *gc, gpointer user_data);
```

Emitted when a connection is about to sign on.

**Parameters:**

**gc**
: The connection that is about to sign on.

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

----

#### signed-on

```c
void user_function(PurpleConnection *gc, gpointer user_data);
```

Emitted when a connection has signed on.

**Parameters:**

**gc**
: The connection that has signed on.

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

----

#### autojoin

```c
gboolean user_function(PurpleConnection *gc, gpointer user_data);
```

Emitted when a connection has signed on, after the signed-on signal, to signal
UIs to autojoin chats if they wish. UIs should connect to this with
`PURPLE_SIGNAL_PRIORITY_HIGHEST` to allow plugins to block this signal before
the UI sees it and then re-emit it later.

**Parameters:**

**gc**
: The connection that has signed on.

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

**Returns:**

`TRUE` if the signal was handled or `FALSE` otherwise.  In practice, the return
value is irrelevant, as it really only exists so plugins can block the UI's
autojoin.

----

#### signing-off

```c
void user_function(PurpleConnection *gc, gpointer user_data);
```

Emitted when a connection is about to sign off.

**Parameters:**

**gc**
: The connection that is about to sign off.

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

----

#### signed-off

```c
void user_function(PurpleConnection *gc, gpointer user_data);
```

Emitted when a connection has signed off.

**Parameters:**

**gc**
: The connection that has signed off.

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

----

#### connection-error

```c
void user_function(PurpleConnection *gc,
                   PurpleConnectionError err,
                   const gchar *desc,
                   gpointer user_data);
```

Emitted when a connection error occurs, before `"signed"`-off.

**Parameters:**

**gc**
: The connection on which the error has occurred.

**err**
: The error that occurred.

**desc**
: A description of the error, giving more information.

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