libpurple/reference/signals_connection.md

changeset 42847
fbb0d252bc35
parent 41164
d861b10105fb
child 42989
0c386608e7a7
equal deleted inserted replaced
42846:c176f1b12aaa 42847:fbb0d252bc35
1 Title: Connection Signals
2 Slug: connection-signals
3
4 ## Connection Signals
5
6 ### Signal List
7
8 * [online](#online)
9 * [offline](#offline)
10 * [signing-on](#signing-on)
11 * [signed-on](#signed-on)
12 * [autojoin](#autojoin)
13 * [signing-off](#signing-off)
14 * [signed-off](#signed-off)
15 * [connection-error](#connection-error)
16
17 ### Signal Details
18
19 #### online
20
21 ```c
22 void user_function(gpointer user_data);
23 ```
24
25 Emitted when the first connection has connected when all connections were
26 previously not connected.
27
28 **Parameters:**
29
30 **user_data**
31 : user data set when the signal handler was connected.
32
33 ----
34
35 #### offline
36
37 ```c
38 void user_function(gpointer user_data);
39 ```
40
41 Emitted when the last connected connection has disconnected.
42
43
44 **Parameters:**
45
46 **user_data**
47 : user data set when the signal handler was connected.
48
49 ----
50
51 #### signing-on
52
53 ```c
54 void user_function(PurpleConnection *gc, gpointer user_data);
55 ```
56
57 Emitted when a connection is about to sign on.
58
59 **Parameters:**
60
61 **gc**
62 : The connection that is about to sign on.
63
64 **user_data**
65 : user data set when the signal handler was connected.
66
67 ----
68
69 #### signed-on
70
71 ```c
72 void user_function(PurpleConnection *gc, gpointer user_data);
73 ```
74
75 Emitted when a connection has signed on.
76
77 **Parameters:**
78
79 **gc**
80 : The connection that has signed on.
81
82 **user_data**
83 : user data set when the signal handler was connected.
84
85 ----
86
87 #### autojoin
88
89 ```c
90 gboolean user_function(PurpleConnection *gc, gpointer user_data);
91 ```
92
93 Emitted when a connection has signed on, after the signed-on signal, to signal
94 UIs to autojoin chats if they wish. UIs should connect to this with
95 `PURPLE_SIGNAL_PRIORITY_HIGHEST` to allow plugins to block this signal before
96 the UI sees it and then re-emit it later.
97
98 **Parameters:**
99
100 **gc**
101 : The connection that has signed on.
102
103 **user_data**
104 : user data set when the signal handler was connected.
105
106 **Returns:**
107
108 `TRUE` if the signal was handled or `FALSE` otherwise. In practice, the return
109 value is irrelevant, as it really only exists so plugins can block the UI's
110 autojoin.
111
112 ----
113
114 #### signing-off
115
116 ```c
117 void user_function(PurpleConnection *gc, gpointer user_data);
118 ```
119
120 Emitted when a connection is about to sign off.
121
122 **Parameters:**
123
124 **gc**
125 : The connection that is about to sign off.
126
127 **user_data**
128 : user data set when the signal handler was connected.
129
130 ----
131
132 #### signed-off
133
134 ```c
135 void user_function(PurpleConnection *gc, gpointer user_data);
136 ```
137
138 Emitted when a connection has signed off.
139
140 **Parameters:**
141
142 **gc**
143 : The connection that has signed off.
144
145 **user_data**
146 : user data set when the signal handler was connected.
147
148 ----
149
150 #### connection-error
151
152 ```c
153 void user_function(PurpleConnection *gc,
154 PurpleConnectionError err,
155 const gchar *desc,
156 gpointer user_data);
157 ```
158
159 Emitted when a connection error occurs, before `"signed"`-off.
160
161 **Parameters:**
162
163 **gc**
164 : The connection on which the error has occurred.
165
166 **err**
167 : The error that occurred.
168
169 **desc**
170 : A description of the error, giving more information.
171
172 **user_data**
173 : user data set when the signal handler was connected.

mercurial