Mercurial > pidgin
annotate src/connection.c @ 8092:697221d5d0ff
[gaim-migrate @ 8791]
Give a nice little warning if you add an AIM or ICQ buddy with an invalid
name. I'm thinking some of those bug reports on SF about "Could not add
buddy with no name" are caused by this. Hopefully. Sometime before the
next release I'll probably actually remove invalid people from the local
list.
Also recognize the WinAIM Video and Camera caps.
committer: Tailor Script <tailor@pidgin.im>
| author | Mark Doliner <mark@kingant.net> |
|---|---|
| date | Tue, 13 Jan 2004 05:44:37 +0000 |
| parents | fa6395637e2c |
| children | ff88d4cbf4db |
| rev | line source |
|---|---|
| 5563 | 1 /** |
| 2 * @file connection.c Connection API | |
| 3 * @ingroup core | |
| 4 * | |
| 5 * gaim | |
| 6 * | |
| 8046 | 7 * Gaim is the legal property of its developers, whose names are too numerous |
| 8 * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 9 * source distribution. | |
| 5631 | 10 * |
| 5563 | 11 * This program is free software; you can redistribute it and/or modify |
| 12 * it under the terms of the GNU General Public License as published by | |
| 13 * the Free Software Foundation; either version 2 of the License, or | |
| 14 * (at your option) any later version. | |
| 15 * | |
| 16 * This program is distributed in the hope that it will be useful, | |
| 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 * GNU General Public License for more details. | |
| 20 * | |
| 21 * You should have received a copy of the GNU General Public License | |
| 22 * along with this program; if not, write to the Free Software | |
| 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 24 */ | |
|
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5859
diff
changeset
|
25 #include "internal.h" |
|
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5859
diff
changeset
|
26 #include "blist.h" |
| 5563 | 27 #include "connection.h" |
| 5717 | 28 #include "debug.h" |
|
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5859
diff
changeset
|
29 #include "log.h" |
|
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5859
diff
changeset
|
30 #include "notify.h" |
|
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5859
diff
changeset
|
31 #include "prefs.h" |
|
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5859
diff
changeset
|
32 #include "request.h" |
|
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5859
diff
changeset
|
33 #include "server.h" |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6468
diff
changeset
|
34 #include "signals.h" |
|
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5859
diff
changeset
|
35 #include "sound.h" |
| 6106 | 36 #include "util.h" |
|
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5859
diff
changeset
|
37 |
| 5563 | 38 static GList *connections = NULL; |
|
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
39 static GList *connections_connecting = NULL; |
| 5563 | 40 static GaimConnectionUiOps *connection_ui_ops = NULL; |
| 41 | |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6468
diff
changeset
|
42 static int connections_handle; |
|
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5859
diff
changeset
|
43 |
| 5563 | 44 GaimConnection * |
| 45 gaim_connection_new(GaimAccount *account) | |
| 46 { | |
| 47 GaimConnection *gc; | |
| 48 | |
| 49 g_return_val_if_fail(account != NULL, NULL); | |
| 50 | |
| 51 gc = g_new0(GaimConnection, 1); | |
| 52 | |
| 7956 | 53 gc->prpl = gaim_find_prpl(gaim_account_get_protocol_id(account)); |
| 5563 | 54 |
| 55 gaim_connection_set_account(gc, account); | |
| 56 gaim_account_set_connection(account, gc); | |
| 57 | |
| 58 return gc; | |
| 59 } | |
| 60 | |
| 61 void | |
| 62 gaim_connection_destroy(GaimConnection *gc) | |
| 63 { | |
|
5741
1b5e6e6e80e9
[gaim-migrate @ 6165]
Christian Hammond <chipx86@chipx86.com>
parents:
5740
diff
changeset
|
64 GaimAccount *account; |
|
1b5e6e6e80e9
[gaim-migrate @ 6165]
Christian Hammond <chipx86@chipx86.com>
parents:
5740
diff
changeset
|
65 |
| 5563 | 66 g_return_if_fail(gc != NULL); |
| 67 | |
| 68 if (gaim_connection_get_state(gc) != GAIM_DISCONNECTED) { | |
| 69 gaim_connection_disconnect(gc); | |
| 70 | |
| 71 return; | |
| 72 } | |
| 73 | |
|
5930
03f1d6cd784c
[gaim-migrate @ 6370]
Christian Hammond <chipx86@chipx86.com>
parents:
5926
diff
changeset
|
74 gaim_debug(GAIM_DEBUG_INFO, "connection", |
|
03f1d6cd784c
[gaim-migrate @ 6370]
Christian Hammond <chipx86@chipx86.com>
parents:
5926
diff
changeset
|
75 "Destroying connection %p\n", gc); |
|
03f1d6cd784c
[gaim-migrate @ 6370]
Christian Hammond <chipx86@chipx86.com>
parents:
5926
diff
changeset
|
76 |
|
5741
1b5e6e6e80e9
[gaim-migrate @ 6165]
Christian Hammond <chipx86@chipx86.com>
parents:
5740
diff
changeset
|
77 account = gaim_connection_get_account(gc); |
|
1b5e6e6e80e9
[gaim-migrate @ 6165]
Christian Hammond <chipx86@chipx86.com>
parents:
5740
diff
changeset
|
78 gaim_account_set_connection(account, NULL); |
|
1b5e6e6e80e9
[gaim-migrate @ 6165]
Christian Hammond <chipx86@chipx86.com>
parents:
5740
diff
changeset
|
79 |
| 5563 | 80 if (gc->display_name != NULL) |
| 81 g_free(gc->display_name); | |
| 82 | |
| 83 if (gc->away != NULL) | |
| 84 g_free(gc->away); | |
| 85 | |
| 86 if (gc->away_state != NULL) | |
| 87 g_free(gc->away_state); | |
| 88 | |
| 6393 | 89 if (gc->disconnect_timeout) |
| 90 g_source_remove(gc->disconnect_timeout); | |
| 91 | |
| 5563 | 92 g_free(gc); |
| 93 } | |
| 94 | |
| 6110 | 95 static void request_pass_ok_cb(GaimAccount *account, const char *entry) |
| 6109 | 96 { |
| 97 gaim_account_set_password(account, (*entry != '\0') ? entry : NULL); | |
| 98 | |
| 6110 | 99 gaim_account_connect(account); |
| 6109 | 100 } |
| 101 | |
| 6581 | 102 void |
| 103 gaim_connection_register(GaimConnection *gc) | |
| 104 { | |
| 105 GaimAccount *account; | |
| 106 GaimConnectionUiOps *ops; | |
| 107 GaimPluginProtocolInfo *prpl_info = NULL; | |
| 108 | |
| 109 g_return_if_fail(gc != NULL); | |
| 110 | |
| 111 gaim_debug(GAIM_DEBUG_INFO, "connection", | |
| 112 "Registering. gc = %p\n", gc); | |
| 113 | |
|
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
114 ops = gaim_connections_get_ui_ops(); |
| 6581 | 115 |
| 116 if (gc->prpl != NULL) | |
| 117 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); | |
| 118 else { | |
| 119 gchar *message = g_strdup_printf(_("Missing protocol plugin for %s"), | |
| 120 gaim_account_get_username(gaim_connection_get_account(gc))); | |
| 121 | |
| 122 gaim_debug(GAIM_DEBUG_ERROR, "connection", | |
| 123 "Could not get prpl info for %p\n", gc); | |
| 124 gaim_notify_error(NULL, _("Registration Error"), | |
| 125 message, NULL); | |
| 126 g_free(message); | |
| 127 return; | |
| 128 } | |
| 129 | |
| 130 account = gaim_connection_get_account(gc); | |
| 131 | |
| 132 if (gaim_connection_get_state(gc) != GAIM_DISCONNECTED) | |
| 133 return; | |
| 134 | |
| 135 gaim_connection_set_state(gc, GAIM_CONNECTING); | |
| 136 | |
| 137 connections = g_list_append(connections, gc); | |
| 138 | |
| 139 gaim_signal_emit(gaim_connections_get_handle(), "signing-on", gc); | |
| 140 | |
| 141 /* set this so we don't auto-reconnect after registering */ | |
| 142 gc->wants_to_die = TRUE; | |
| 143 | |
| 144 gaim_debug(GAIM_DEBUG_INFO, "connection", "Calling register_user\n"); | |
| 145 | |
| 146 prpl_info->register_user(account); | |
| 147 } | |
| 148 | |
| 6109 | 149 |
| 5563 | 150 void |
| 151 gaim_connection_connect(GaimConnection *gc) | |
| 152 { | |
| 153 GaimAccount *account; | |
| 154 GaimConnectionUiOps *ops; | |
| 155 GaimPluginProtocolInfo *prpl_info = NULL; | |
| 156 | |
| 157 g_return_if_fail(gc != NULL); | |
| 158 | |
|
5930
03f1d6cd784c
[gaim-migrate @ 6370]
Christian Hammond <chipx86@chipx86.com>
parents:
5926
diff
changeset
|
159 gaim_debug(GAIM_DEBUG_INFO, "connection", |
|
03f1d6cd784c
[gaim-migrate @ 6370]
Christian Hammond <chipx86@chipx86.com>
parents:
5926
diff
changeset
|
160 "Connecting. gc = %p\n", gc); |
|
03f1d6cd784c
[gaim-migrate @ 6370]
Christian Hammond <chipx86@chipx86.com>
parents:
5926
diff
changeset
|
161 |
|
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
162 ops = gaim_connections_get_ui_ops(); |
| 5563 | 163 |
|
6136
e391813214a6
[gaim-migrate @ 6610]
Christian Hammond <chipx86@chipx86.com>
parents:
6113
diff
changeset
|
164 if (gc->prpl != NULL) |
|
e391813214a6
[gaim-migrate @ 6610]
Christian Hammond <chipx86@chipx86.com>
parents:
6113
diff
changeset
|
165 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); |
|
e391813214a6
[gaim-migrate @ 6610]
Christian Hammond <chipx86@chipx86.com>
parents:
6113
diff
changeset
|
166 else { |
|
e391813214a6
[gaim-migrate @ 6610]
Christian Hammond <chipx86@chipx86.com>
parents:
6113
diff
changeset
|
167 gchar *message = g_strdup_printf(_("Missing protocol plugin for %s"), |
|
e391813214a6
[gaim-migrate @ 6610]
Christian Hammond <chipx86@chipx86.com>
parents:
6113
diff
changeset
|
168 gaim_account_get_username(gaim_connection_get_account(gc))); |
|
e391813214a6
[gaim-migrate @ 6610]
Christian Hammond <chipx86@chipx86.com>
parents:
6113
diff
changeset
|
169 |
|
e391813214a6
[gaim-migrate @ 6610]
Christian Hammond <chipx86@chipx86.com>
parents:
6113
diff
changeset
|
170 gaim_debug(GAIM_DEBUG_ERROR, "connection", |
|
e391813214a6
[gaim-migrate @ 6610]
Christian Hammond <chipx86@chipx86.com>
parents:
6113
diff
changeset
|
171 "Could not get prpl info for %p\n", gc); |
|
e391813214a6
[gaim-migrate @ 6610]
Christian Hammond <chipx86@chipx86.com>
parents:
6113
diff
changeset
|
172 gaim_notify_error(NULL, _("Connection Error"), |
|
e391813214a6
[gaim-migrate @ 6610]
Christian Hammond <chipx86@chipx86.com>
parents:
6113
diff
changeset
|
173 message, NULL); |
|
e391813214a6
[gaim-migrate @ 6610]
Christian Hammond <chipx86@chipx86.com>
parents:
6113
diff
changeset
|
174 g_free(message); |
|
e391813214a6
[gaim-migrate @ 6610]
Christian Hammond <chipx86@chipx86.com>
parents:
6113
diff
changeset
|
175 return; |
|
e391813214a6
[gaim-migrate @ 6610]
Christian Hammond <chipx86@chipx86.com>
parents:
6113
diff
changeset
|
176 } |
| 5563 | 177 |
| 178 account = gaim_connection_get_account(gc); | |
| 179 | |
| 6109 | 180 if (gaim_connection_get_state(gc) != GAIM_DISCONNECTED) |
| 181 return; | |
| 182 | |
| 6036 | 183 if (!(prpl_info->options & OPT_PROTO_NO_PASSWORD) && |
| 6231 | 184 !(prpl_info->options & OPT_PROTO_PASSWORD_OPTIONAL) && |
| 185 gaim_account_get_password(account) == NULL) { | |
| 6111 | 186 gchar *primary; |
| 6231 | 187 gchar *escaped; |
| 188 const gchar *username = gaim_account_get_username(account); | |
| 189 | |
|
5930
03f1d6cd784c
[gaim-migrate @ 6370]
Christian Hammond <chipx86@chipx86.com>
parents:
5926
diff
changeset
|
190 gaim_debug(GAIM_DEBUG_INFO, "connection", "Requesting password\n"); |
|
6468
4aa3b1cec52b
[gaim-migrate @ 6977]
Christian Hammond <chipx86@chipx86.com>
parents:
6460
diff
changeset
|
191 gaim_connection_destroy(gc); |
| 6231 | 192 escaped = g_markup_escape_text(username, strlen(username)); |
| 193 primary = g_strdup_printf(_("Enter password for %s"), escaped); | |
| 6111 | 194 gaim_request_input(gc, NULL, primary, NULL, NULL, FALSE, TRUE, |
| 6109 | 195 _("OK"), G_CALLBACK(request_pass_ok_cb), |
| 6110 | 196 _("Cancel"), NULL, account); |
| 6111 | 197 g_free(primary); |
| 6231 | 198 g_free(escaped); |
| 5563 | 199 |
| 200 return; | |
| 201 } | |
| 202 | |
| 203 gaim_connection_set_state(gc, GAIM_CONNECTING); | |
| 204 | |
| 6507 | 205 connections = g_list_append(connections, gc); |
| 206 | |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6468
diff
changeset
|
207 gaim_signal_emit(gaim_connections_get_handle(), "signing-on", gc); |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6468
diff
changeset
|
208 |
|
5581
3a9b54f260e3
[gaim-migrate @ 5985]
Christian Hammond <chipx86@chipx86.com>
parents:
5571
diff
changeset
|
209 gaim_debug(GAIM_DEBUG_INFO, "connection", "Calling serv_login\n"); |
|
3a9b54f260e3
[gaim-migrate @ 5985]
Christian Hammond <chipx86@chipx86.com>
parents:
5571
diff
changeset
|
210 |
| 5563 | 211 serv_login(account); |
| 212 } | |
| 213 | |
| 214 void | |
| 215 gaim_connection_disconnect(GaimConnection *gc) | |
| 216 { | |
|
5926
6c22d37c6a3c
[gaim-migrate @ 6366]
Christian Hammond <chipx86@chipx86.com>
parents:
5905
diff
changeset
|
217 GaimAccount *account; |
| 5563 | 218 GList *wins; |
| 219 | |
| 220 g_return_if_fail(gc != NULL); | |
| 221 | |
|
5926
6c22d37c6a3c
[gaim-migrate @ 6366]
Christian Hammond <chipx86@chipx86.com>
parents:
5905
diff
changeset
|
222 account = gaim_connection_get_account(gc); |
|
6c22d37c6a3c
[gaim-migrate @ 6366]
Christian Hammond <chipx86@chipx86.com>
parents:
5905
diff
changeset
|
223 |
|
6c22d37c6a3c
[gaim-migrate @ 6366]
Christian Hammond <chipx86@chipx86.com>
parents:
5905
diff
changeset
|
224 if (gaim_account_get_connection(account) != NULL) { |
|
6c22d37c6a3c
[gaim-migrate @ 6366]
Christian Hammond <chipx86@chipx86.com>
parents:
5905
diff
changeset
|
225 gaim_account_disconnect(account); |
|
6c22d37c6a3c
[gaim-migrate @ 6366]
Christian Hammond <chipx86@chipx86.com>
parents:
5905
diff
changeset
|
226 return; |
|
6c22d37c6a3c
[gaim-migrate @ 6366]
Christian Hammond <chipx86@chipx86.com>
parents:
5905
diff
changeset
|
227 } |
|
6c22d37c6a3c
[gaim-migrate @ 6366]
Christian Hammond <chipx86@chipx86.com>
parents:
5905
diff
changeset
|
228 |
|
5930
03f1d6cd784c
[gaim-migrate @ 6370]
Christian Hammond <chipx86@chipx86.com>
parents:
5926
diff
changeset
|
229 gaim_debug(GAIM_DEBUG_INFO, "connection", |
|
03f1d6cd784c
[gaim-migrate @ 6370]
Christian Hammond <chipx86@chipx86.com>
parents:
5926
diff
changeset
|
230 "Disconnecting connection %p\n", gc); |
|
03f1d6cd784c
[gaim-migrate @ 6370]
Christian Hammond <chipx86@chipx86.com>
parents:
5926
diff
changeset
|
231 |
|
5740
6ec7b32ab1df
[gaim-migrate @ 6164]
Christian Hammond <chipx86@chipx86.com>
parents:
5727
diff
changeset
|
232 if (gaim_connection_get_state(gc) != GAIM_DISCONNECTED) { |
|
6ec7b32ab1df
[gaim-migrate @ 6164]
Christian Hammond <chipx86@chipx86.com>
parents:
5727
diff
changeset
|
233 if (gaim_connection_get_state(gc) != GAIM_CONNECTING) |
|
6ec7b32ab1df
[gaim-migrate @ 6164]
Christian Hammond <chipx86@chipx86.com>
parents:
5727
diff
changeset
|
234 gaim_blist_remove_account(gaim_connection_get_account(gc)); |
| 5563 | 235 |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6468
diff
changeset
|
236 gaim_signal_emit(gaim_connections_get_handle(), "signing-off", gc); |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6468
diff
changeset
|
237 |
|
5740
6ec7b32ab1df
[gaim-migrate @ 6164]
Christian Hammond <chipx86@chipx86.com>
parents:
5727
diff
changeset
|
238 serv_close(gc); |
| 5563 | 239 |
| 6533 | 240 connections = g_list_remove(connections, gc); |
| 241 | |
|
5859
022786c7ab53
[gaim-migrate @ 6290]
Christian Hammond <chipx86@chipx86.com>
parents:
5788
diff
changeset
|
242 gaim_connection_set_state(gc, GAIM_DISCONNECTED); |
| 5563 | 243 |
| 7431 | 244 /* LOG system_log(log_signoff, gc, NULL, |
| 245 OPT_LOG_BUDDY_SIGNON | OPT_LOG_MY_SIGNON); */ | |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6468
diff
changeset
|
246 gaim_signal_emit(gaim_connections_get_handle(), "signed-off", gc); |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6468
diff
changeset
|
247 |
|
5615
6500a6c8d679
[gaim-migrate @ 6022]
Christian Hammond <chipx86@chipx86.com>
parents:
5581
diff
changeset
|
248 |
|
5740
6ec7b32ab1df
[gaim-migrate @ 6164]
Christian Hammond <chipx86@chipx86.com>
parents:
5727
diff
changeset
|
249 /* |
|
6ec7b32ab1df
[gaim-migrate @ 6164]
Christian Hammond <chipx86@chipx86.com>
parents:
5727
diff
changeset
|
250 * XXX This is a hack! Remove this and replace it with a better event |
|
6ec7b32ab1df
[gaim-migrate @ 6164]
Christian Hammond <chipx86@chipx86.com>
parents:
5727
diff
changeset
|
251 * notification system. |
|
6ec7b32ab1df
[gaim-migrate @ 6164]
Christian Hammond <chipx86@chipx86.com>
parents:
5727
diff
changeset
|
252 */ |
|
6ec7b32ab1df
[gaim-migrate @ 6164]
Christian Hammond <chipx86@chipx86.com>
parents:
5727
diff
changeset
|
253 for (wins = gaim_get_windows(); wins != NULL; wins = wins->next) { |
|
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
254 GaimConvWindow *win = (GaimConvWindow *)wins->data; |
|
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
255 gaim_conversation_update(gaim_conv_window_get_conversation_at(win, 0), |
|
5740
6ec7b32ab1df
[gaim-migrate @ 6164]
Christian Hammond <chipx86@chipx86.com>
parents:
5727
diff
changeset
|
256 GAIM_CONV_ACCOUNT_OFFLINE); |
|
6ec7b32ab1df
[gaim-migrate @ 6164]
Christian Hammond <chipx86@chipx86.com>
parents:
5727
diff
changeset
|
257 } |
|
6ec7b32ab1df
[gaim-migrate @ 6164]
Christian Hammond <chipx86@chipx86.com>
parents:
5727
diff
changeset
|
258 |
|
6ec7b32ab1df
[gaim-migrate @ 6164]
Christian Hammond <chipx86@chipx86.com>
parents:
5727
diff
changeset
|
259 gaim_request_close_with_handle(gc); |
|
6ec7b32ab1df
[gaim-migrate @ 6164]
Christian Hammond <chipx86@chipx86.com>
parents:
5727
diff
changeset
|
260 gaim_notify_close_with_handle(gc); |
| 5563 | 261 } |
| 262 | |
|
5622
70ae81fc802f
[gaim-migrate @ 6029]
Christian Hammond <chipx86@chipx86.com>
parents:
5615
diff
changeset
|
263 gaim_connection_destroy(gc); |
| 5563 | 264 } |
| 265 | |
| 6029 | 266 gboolean |
| 267 gaim_connection_disconnect_cb(gpointer data) | |
| 268 { | |
| 6076 | 269 GaimAccount *account = data; |
| 270 GaimConnection *gc = gaim_account_get_connection(account); | |
| 6029 | 271 |
| 6076 | 272 if(gc) |
| 273 gaim_connection_disconnect(gc); | |
| 6029 | 274 |
| 275 return FALSE; | |
| 276 } | |
| 277 | |
| 5563 | 278 /* |
| 279 * d:)->-< | |
| 280 * | |
| 281 * d:O-\-< | |
| 282 * | |
| 283 * d:D-/-< | |
| 284 * | |
| 285 * d8D->-< DANCE! | |
| 286 */ | |
| 287 | |
| 288 void | |
| 289 gaim_connection_set_state(GaimConnection *gc, GaimConnectionState state) | |
| 290 { | |
|
5885
02569519d0cc
[gaim-migrate @ 6317]
Christian Hammond <chipx86@chipx86.com>
parents:
5883
diff
changeset
|
291 GaimConnectionUiOps *ops; |
|
02569519d0cc
[gaim-migrate @ 6317]
Christian Hammond <chipx86@chipx86.com>
parents:
5883
diff
changeset
|
292 |
| 5563 | 293 g_return_if_fail(gc != NULL); |
| 294 | |
|
5784
72fb22b9ac98
[gaim-migrate @ 6209]
Christian Hammond <chipx86@chipx86.com>
parents:
5741
diff
changeset
|
295 if (gc->state == state) |
|
72fb22b9ac98
[gaim-migrate @ 6209]
Christian Hammond <chipx86@chipx86.com>
parents:
5741
diff
changeset
|
296 return; |
|
72fb22b9ac98
[gaim-migrate @ 6209]
Christian Hammond <chipx86@chipx86.com>
parents:
5741
diff
changeset
|
297 |
| 5563 | 298 gc->state = state; |
| 299 | |
|
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
300 ops = gaim_connections_get_ui_ops(); |
|
5885
02569519d0cc
[gaim-migrate @ 6317]
Christian Hammond <chipx86@chipx86.com>
parents:
5883
diff
changeset
|
301 |
|
5905
dbe2a2174be9
[gaim-migrate @ 6337]
Christian Hammond <chipx86@chipx86.com>
parents:
5885
diff
changeset
|
302 if (gc->state == GAIM_CONNECTING) { |
|
dbe2a2174be9
[gaim-migrate @ 6337]
Christian Hammond <chipx86@chipx86.com>
parents:
5885
diff
changeset
|
303 connections_connecting = g_list_append(connections_connecting, gc); |
|
dbe2a2174be9
[gaim-migrate @ 6337]
Christian Hammond <chipx86@chipx86.com>
parents:
5885
diff
changeset
|
304 } |
|
dbe2a2174be9
[gaim-migrate @ 6337]
Christian Hammond <chipx86@chipx86.com>
parents:
5885
diff
changeset
|
305 else { |
|
5885
02569519d0cc
[gaim-migrate @ 6317]
Christian Hammond <chipx86@chipx86.com>
parents:
5883
diff
changeset
|
306 connections_connecting = g_list_remove(connections_connecting, gc); |
|
5905
dbe2a2174be9
[gaim-migrate @ 6337]
Christian Hammond <chipx86@chipx86.com>
parents:
5885
diff
changeset
|
307 } |
|
5885
02569519d0cc
[gaim-migrate @ 6317]
Christian Hammond <chipx86@chipx86.com>
parents:
5883
diff
changeset
|
308 |
| 5563 | 309 if (gc->state == GAIM_CONNECTED) { |
| 6695 | 310 GaimBlistNode *gnode,*cnode,*bnode; |
| 5563 | 311 GList *wins; |
| 312 GList *add_buds=NULL; | |
| 313 | |
| 314 /* Set the time the account came online */ | |
| 315 time(&gc->login_time); | |
| 316 | |
| 317 if (ops != NULL && ops->connected != NULL) | |
| 318 ops->connected(gc); | |
| 319 | |
| 320 gaim_blist_show(); | |
| 321 gaim_blist_add_account(gc->account); | |
| 322 | |
| 323 /* | |
| 324 * XXX This is a hack! Remove this and replace it with a better event | |
| 325 * notification system. | |
| 326 */ | |
| 327 for (wins = gaim_get_windows(); wins != NULL; wins = wins->next) { | |
|
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
328 GaimConvWindow *win = (GaimConvWindow *)wins->data; |
|
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
329 gaim_conversation_update(gaim_conv_window_get_conversation_at(win, 0), |
| 5563 | 330 GAIM_CONV_ACCOUNT_ONLINE); |
| 331 } | |
| 332 | |
| 7431 | 333 /* LOG system_log(log_signon, gc, NULL, |
| 334 OPT_LOG_BUDDY_SIGNON | OPT_LOG_MY_SIGNON); */ | |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6468
diff
changeset
|
335 gaim_signal_emit(gaim_connections_get_handle(), "signed-on", gc); |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6468
diff
changeset
|
336 |
| 5563 | 337 #if 0 |
| 338 /* away option given? */ | |
| 339 if (opt_away) { | |
| 340 away_on_login(opt_away_arg); | |
| 341 /* don't do it again */ | |
| 342 opt_away = 0; | |
| 343 } else if (awaymessage) { | |
| 344 serv_set_away(gc, GAIM_AWAY_CUSTOM, awaymessage->message); | |
| 345 } | |
| 346 if (opt_away_arg != NULL) { | |
| 347 g_free(opt_away_arg); | |
| 348 opt_away_arg = NULL; | |
| 349 } | |
| 350 #endif | |
| 351 | |
| 352 /* let the prpl know what buddies we pulled out of the local list */ | |
| 353 for (gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) { | |
| 354 if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) | |
| 355 continue; | |
| 6695 | 356 for(cnode = gnode->child; cnode; cnode = cnode->next) { |
| 357 if(!GAIM_BLIST_NODE_IS_CONTACT(cnode)) | |
| 358 continue; | |
| 359 for(bnode = cnode->child; bnode; bnode = bnode->next) { | |
| 360 GaimBuddy *b; | |
| 361 if(!GAIM_BLIST_NODE_IS_BUDDY(bnode)) | |
| 362 continue; | |
| 363 | |
| 364 b = (GaimBuddy *)bnode; | |
| 5563 | 365 if(b->account == gc->account) { |
| 366 add_buds = g_list_append(add_buds, b->name); | |
| 367 } | |
| 368 } | |
| 369 } | |
| 370 } | |
| 371 | |
| 372 if(add_buds) { | |
| 373 serv_add_buddies(gc, add_buds); | |
| 374 g_list_free(add_buds); | |
| 375 } | |
| 376 | |
| 377 serv_set_permit_deny(gc); | |
| 378 } | |
|
5885
02569519d0cc
[gaim-migrate @ 6317]
Christian Hammond <chipx86@chipx86.com>
parents:
5883
diff
changeset
|
379 else if (gc->state == GAIM_DISCONNECTED) { |
|
02569519d0cc
[gaim-migrate @ 6317]
Christian Hammond <chipx86@chipx86.com>
parents:
5883
diff
changeset
|
380 if (ops != NULL && ops->disconnected != NULL) |
|
6460
ff4551719cc7
[gaim-migrate @ 6969]
Christian Hammond <chipx86@chipx86.com>
parents:
6393
diff
changeset
|
381 ops->disconnected(gc); |
|
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
382 } |
| 5563 | 383 } |
| 384 | |
| 385 void | |
| 386 gaim_connection_set_account(GaimConnection *gc, GaimAccount *account) | |
| 387 { | |
| 388 g_return_if_fail(gc != NULL); | |
| 389 g_return_if_fail(account != NULL); | |
| 390 | |
| 391 gc->account = account; | |
| 392 } | |
| 393 | |
| 394 void | |
| 395 gaim_connection_set_display_name(GaimConnection *gc, const char *name) | |
| 396 { | |
| 397 g_return_if_fail(gc != NULL); | |
| 398 | |
| 399 if (gc->display_name != NULL) | |
| 400 g_free(gc->display_name); | |
| 401 | |
| 402 gc->display_name = (name == NULL ? NULL : g_strdup(name)); | |
| 403 } | |
| 404 | |
| 405 GaimConnectionState | |
| 406 gaim_connection_get_state(const GaimConnection *gc) | |
| 407 { | |
| 408 g_return_val_if_fail(gc != NULL, GAIM_DISCONNECTED); | |
| 409 | |
| 410 return gc->state; | |
| 411 } | |
| 412 | |
| 413 GaimAccount * | |
| 414 gaim_connection_get_account(const GaimConnection *gc) | |
| 415 { | |
| 416 g_return_val_if_fail(gc != NULL, NULL); | |
| 417 | |
| 418 return gc->account; | |
| 419 } | |
| 420 | |
| 421 const char * | |
| 422 gaim_connection_get_display_name(const GaimConnection *gc) | |
| 423 { | |
| 424 g_return_val_if_fail(gc != NULL, NULL); | |
| 425 | |
| 426 return gc->display_name; | |
| 427 } | |
| 428 | |
| 429 void | |
| 430 gaim_connection_update_progress(GaimConnection *gc, const char *text, | |
| 431 size_t step, size_t count) | |
| 432 { | |
| 433 GaimConnectionUiOps *ops; | |
| 434 | |
| 435 g_return_if_fail(gc != NULL); | |
| 436 g_return_if_fail(text != NULL); | |
| 437 g_return_if_fail(step < count); | |
| 438 g_return_if_fail(count > 1); | |
| 439 | |
|
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
440 ops = gaim_connections_get_ui_ops(); |
| 5563 | 441 |
| 442 if (ops != NULL && ops->connect_progress != NULL) | |
| 443 ops->connect_progress(gc, text, step, count); | |
| 444 } | |
| 445 | |
| 446 void | |
|
5571
113090160626
[gaim-migrate @ 5973]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
447 gaim_connection_notice(GaimConnection *gc, const char *text) |
|
113090160626
[gaim-migrate @ 5973]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
448 { |
|
113090160626
[gaim-migrate @ 5973]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
449 GaimConnectionUiOps *ops; |
|
113090160626
[gaim-migrate @ 5973]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
450 |
|
113090160626
[gaim-migrate @ 5973]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
451 g_return_if_fail(gc != NULL); |
|
113090160626
[gaim-migrate @ 5973]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
452 g_return_if_fail(text != NULL); |
|
113090160626
[gaim-migrate @ 5973]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
453 |
|
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
454 ops = gaim_connections_get_ui_ops(); |
|
5571
113090160626
[gaim-migrate @ 5973]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
455 |
|
113090160626
[gaim-migrate @ 5973]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
456 if (ops != NULL && ops->notice != NULL) |
|
113090160626
[gaim-migrate @ 5973]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
457 ops->notice(gc, text); |
|
113090160626
[gaim-migrate @ 5973]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
458 } |
|
113090160626
[gaim-migrate @ 5973]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
459 |
|
113090160626
[gaim-migrate @ 5973]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
460 void |
|
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
461 gaim_connection_error(GaimConnection *gc, const char *text) |
|
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
462 { |
|
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
463 GaimConnectionUiOps *ops; |
|
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
464 |
|
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
465 g_return_if_fail(gc != NULL); |
|
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
466 g_return_if_fail(text != NULL); |
|
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
467 |
| 6393 | 468 /* If we've already got one error, we don't need any more */ |
|
6460
ff4551719cc7
[gaim-migrate @ 6969]
Christian Hammond <chipx86@chipx86.com>
parents:
6393
diff
changeset
|
469 if (gc->disconnect_timeout) |
| 6393 | 470 return; |
| 471 | |
|
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
472 ops = gaim_connections_get_ui_ops(); |
|
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
473 |
|
6460
ff4551719cc7
[gaim-migrate @ 6969]
Christian Hammond <chipx86@chipx86.com>
parents:
6393
diff
changeset
|
474 if (ops != NULL) { |
|
ff4551719cc7
[gaim-migrate @ 6969]
Christian Hammond <chipx86@chipx86.com>
parents:
6393
diff
changeset
|
475 if (ops->report_disconnect != NULL) |
|
ff4551719cc7
[gaim-migrate @ 6969]
Christian Hammond <chipx86@chipx86.com>
parents:
6393
diff
changeset
|
476 ops->report_disconnect(gc, text); |
|
ff4551719cc7
[gaim-migrate @ 6969]
Christian Hammond <chipx86@chipx86.com>
parents:
6393
diff
changeset
|
477 |
|
ff4551719cc7
[gaim-migrate @ 6969]
Christian Hammond <chipx86@chipx86.com>
parents:
6393
diff
changeset
|
478 if (ops->disconnected != NULL) |
|
ff4551719cc7
[gaim-migrate @ 6969]
Christian Hammond <chipx86@chipx86.com>
parents:
6393
diff
changeset
|
479 ops->disconnected(gc); |
|
ff4551719cc7
[gaim-migrate @ 6969]
Christian Hammond <chipx86@chipx86.com>
parents:
6393
diff
changeset
|
480 } |
| 5727 | 481 |
| 6393 | 482 gc->disconnect_timeout = g_timeout_add(0, gaim_connection_disconnect_cb, |
| 6076 | 483 gaim_connection_get_account(gc)); |
|
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
484 } |
|
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
485 |
|
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
486 void |
| 5563 | 487 gaim_connections_disconnect_all(void) |
| 488 { | |
| 489 GList *l; | |
| 6113 | 490 GaimConnection *gc; |
| 5563 | 491 |
| 6113 | 492 while ((l = gaim_connections_get_all()) != NULL) { |
| 493 gc = l->data; | |
| 494 gc->wants_to_die = TRUE; | |
| 495 gaim_connection_destroy(gc); | |
| 496 } | |
| 5563 | 497 } |
| 498 | |
| 499 GList * | |
| 500 gaim_connections_get_all(void) | |
| 501 { | |
| 502 return connections; | |
| 503 } | |
| 504 | |
|
5788
8c237274189f
[gaim-migrate @ 6213]
Christian Hammond <chipx86@chipx86.com>
parents:
5784
diff
changeset
|
505 GList * |
|
8c237274189f
[gaim-migrate @ 6213]
Christian Hammond <chipx86@chipx86.com>
parents:
5784
diff
changeset
|
506 gaim_connections_get_connecting(void) |
|
8c237274189f
[gaim-migrate @ 6213]
Christian Hammond <chipx86@chipx86.com>
parents:
5784
diff
changeset
|
507 { |
|
8c237274189f
[gaim-migrate @ 6213]
Christian Hammond <chipx86@chipx86.com>
parents:
5784
diff
changeset
|
508 return connections_connecting; |
|
8c237274189f
[gaim-migrate @ 6213]
Christian Hammond <chipx86@chipx86.com>
parents:
5784
diff
changeset
|
509 } |
|
8c237274189f
[gaim-migrate @ 6213]
Christian Hammond <chipx86@chipx86.com>
parents:
5784
diff
changeset
|
510 |
| 5563 | 511 void |
|
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
512 gaim_connections_set_ui_ops(GaimConnectionUiOps *ops) |
|
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
513 { |
|
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
514 connection_ui_ops = ops; |
|
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
515 } |
|
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
516 |
|
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
517 GaimConnectionUiOps * |
|
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
518 gaim_connections_get_ui_ops(void) |
|
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
519 { |
|
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
520 return connection_ui_ops; |
|
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
521 } |
|
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
522 |
|
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
523 void |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6468
diff
changeset
|
524 gaim_connections_init(void) |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6468
diff
changeset
|
525 { |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6468
diff
changeset
|
526 void *handle = gaim_connections_get_handle(); |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6468
diff
changeset
|
527 |
|
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6533
diff
changeset
|
528 gaim_signal_register(handle, "signing-on", |
|
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6533
diff
changeset
|
529 gaim_marshal_VOID__POINTER, NULL, 1, |
|
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6533
diff
changeset
|
530 gaim_value_new(GAIM_TYPE_SUBTYPE, |
|
6597
fe569b675cd2
[gaim-migrate @ 7121]
Christian Hammond <chipx86@chipx86.com>
parents:
6581
diff
changeset
|
531 GAIM_SUBTYPE_CONNECTION)); |
|
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6533
diff
changeset
|
532 |
|
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6533
diff
changeset
|
533 gaim_signal_register(handle, "signed-on", |
|
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6533
diff
changeset
|
534 gaim_marshal_VOID__POINTER, NULL, 1, |
|
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6533
diff
changeset
|
535 gaim_value_new(GAIM_TYPE_SUBTYPE, |
|
6597
fe569b675cd2
[gaim-migrate @ 7121]
Christian Hammond <chipx86@chipx86.com>
parents:
6581
diff
changeset
|
536 GAIM_SUBTYPE_CONNECTION)); |
|
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6533
diff
changeset
|
537 |
|
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6533
diff
changeset
|
538 gaim_signal_register(handle, "signing-off", |
|
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6533
diff
changeset
|
539 gaim_marshal_VOID__POINTER, NULL, 1, |
|
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6533
diff
changeset
|
540 gaim_value_new(GAIM_TYPE_SUBTYPE, |
|
6597
fe569b675cd2
[gaim-migrate @ 7121]
Christian Hammond <chipx86@chipx86.com>
parents:
6581
diff
changeset
|
541 GAIM_SUBTYPE_CONNECTION)); |
|
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6533
diff
changeset
|
542 |
|
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6533
diff
changeset
|
543 gaim_signal_register(handle, "signed-off", |
|
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6533
diff
changeset
|
544 gaim_marshal_VOID__POINTER, NULL, 1, |
|
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6533
diff
changeset
|
545 gaim_value_new(GAIM_TYPE_SUBTYPE, |
|
6597
fe569b675cd2
[gaim-migrate @ 7121]
Christian Hammond <chipx86@chipx86.com>
parents:
6581
diff
changeset
|
546 GAIM_SUBTYPE_CONNECTION)); |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6468
diff
changeset
|
547 } |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6468
diff
changeset
|
548 |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6468
diff
changeset
|
549 void |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6468
diff
changeset
|
550 gaim_connections_uninit(void) |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6468
diff
changeset
|
551 { |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6468
diff
changeset
|
552 gaim_signals_unregister_by_instance(gaim_connections_get_handle()); |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6468
diff
changeset
|
553 } |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6468
diff
changeset
|
554 |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6468
diff
changeset
|
555 void * |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6468
diff
changeset
|
556 gaim_connections_get_handle(void) |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6468
diff
changeset
|
557 { |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6468
diff
changeset
|
558 return &connections_handle; |
|
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6468
diff
changeset
|
559 } |
