Mercurial > pidgin
comparison libgaim/server.c @ 14607:f23506e8f812
[gaim-migrate @ 17335]
Get rid of some checks to make sure gc is valid. They shouldn't be
necessary (and a lot of them were poorly implemented anyway). Let
me know if you notice any crashes.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Fri, 22 Sep 2006 05:42:01 +0000 |
parents | aee74d84816c |
children | 0a9c44ce9a4a |
comparison
equal
deleted
inserted
replaced
14606:a35ed72bf50a | 14607:f23506e8f812 |
---|---|
171 GaimAccount *account; | 171 GaimAccount *account; |
172 | 172 |
173 if (gc != NULL && gc->prpl != NULL) | 173 if (gc != NULL && gc->prpl != NULL) |
174 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); | 174 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); |
175 | 175 |
176 if (prpl_info && g_list_find(gaim_connections_get_all(), gc) && | 176 if (prpl_info && prpl_info->set_info) { |
177 prpl_info->set_info) { | |
178 | 177 |
179 account = gaim_connection_get_account(gc); | 178 account = gaim_connection_get_account(gc); |
180 | 179 |
181 if (gaim_signal_emit_return_1(gaim_accounts_get_handle(), | 180 if (gaim_signal_emit_return_1(gaim_accounts_get_handle(), |
182 "account-setting-info", account, info)) | 181 "account-setting-info", account, info)) |
268 GaimPluginProtocolInfo *prpl_info = NULL; | 267 GaimPluginProtocolInfo *prpl_info = NULL; |
269 | 268 |
270 if (g != NULL && g->prpl != NULL) | 269 if (g != NULL && g->prpl != NULL) |
271 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl); | 270 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl); |
272 | 271 |
273 if (prpl_info && g_list_find(gaim_connections_get_all(), g) && prpl_info->add_permit) | 272 if (prpl_info && prpl_info->add_permit) |
274 prpl_info->add_permit(g, name); | 273 prpl_info->add_permit(g, name); |
275 } | 274 } |
276 | 275 |
277 void serv_add_deny(GaimConnection *g, const char *name) | 276 void serv_add_deny(GaimConnection *g, const char *name) |
278 { | 277 { |
279 GaimPluginProtocolInfo *prpl_info = NULL; | 278 GaimPluginProtocolInfo *prpl_info = NULL; |
280 | 279 |
281 if (g != NULL && g->prpl != NULL) | 280 if (g != NULL && g->prpl != NULL) |
282 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl); | 281 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl); |
283 | 282 |
284 if (prpl_info && g_list_find(gaim_connections_get_all(), g) && prpl_info->add_deny) | 283 if (prpl_info && prpl_info->add_deny) |
285 prpl_info->add_deny(g, name); | 284 prpl_info->add_deny(g, name); |
286 } | 285 } |
287 | 286 |
288 void serv_rem_permit(GaimConnection *g, const char *name) | 287 void serv_rem_permit(GaimConnection *g, const char *name) |
289 { | 288 { |
290 GaimPluginProtocolInfo *prpl_info = NULL; | 289 GaimPluginProtocolInfo *prpl_info = NULL; |
291 | 290 |
292 if (g != NULL && g->prpl != NULL) | 291 if (g != NULL && g->prpl != NULL) |
293 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl); | 292 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl); |
294 | 293 |
295 if (prpl_info && g_list_find(gaim_connections_get_all(), g) && prpl_info->rem_permit) | 294 if (prpl_info && prpl_info->rem_permit) |
296 prpl_info->rem_permit(g, name); | 295 prpl_info->rem_permit(g, name); |
297 } | 296 } |
298 | 297 |
299 void serv_rem_deny(GaimConnection *g, const char *name) | 298 void serv_rem_deny(GaimConnection *g, const char *name) |
300 { | 299 { |
301 GaimPluginProtocolInfo *prpl_info = NULL; | 300 GaimPluginProtocolInfo *prpl_info = NULL; |
302 | 301 |
303 if (g != NULL && g->prpl != NULL) | 302 if (g != NULL && g->prpl != NULL) |
304 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl); | 303 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl); |
305 | 304 |
306 if (prpl_info && g_list_find(gaim_connections_get_all(), g) && prpl_info->rem_deny) | 305 if (prpl_info && prpl_info->rem_deny) |
307 prpl_info->rem_deny(g, name); | 306 prpl_info->rem_deny(g, name); |
308 } | 307 } |
309 | 308 |
310 void serv_set_permit_deny(GaimConnection *g) | 309 void serv_set_permit_deny(GaimConnection *g) |
311 { | 310 { |
318 * this is called when either you import a buddy list, and make lots | 317 * this is called when either you import a buddy list, and make lots |
319 * of changes that way, or when the user toggles the permit/deny mode | 318 * of changes that way, or when the user toggles the permit/deny mode |
320 * in the prefs. In either case you should probably be resetting and | 319 * in the prefs. In either case you should probably be resetting and |
321 * resending the permit/deny info when you get this. | 320 * resending the permit/deny info when you get this. |
322 */ | 321 */ |
323 if (prpl_info && g_list_find(gaim_connections_get_all(), g) && prpl_info->set_permit_deny) | 322 if (prpl_info && prpl_info->set_permit_deny) |
324 prpl_info->set_permit_deny(g); | 323 prpl_info->set_permit_deny(g); |
325 } | 324 } |
326 | 325 |
327 void serv_join_chat(GaimConnection *g, GHashTable *data) | 326 void serv_join_chat(GaimConnection *g, GHashTable *data) |
328 { | 327 { |
329 GaimPluginProtocolInfo *prpl_info = NULL; | 328 GaimPluginProtocolInfo *prpl_info = NULL; |
330 | 329 |
331 if (g != NULL && g->prpl != NULL) | 330 if (g != NULL && g->prpl != NULL) |
332 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl); | 331 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl); |
333 | 332 |
334 if (prpl_info && g_list_find(gaim_connections_get_all(), g) && prpl_info->join_chat) | 333 if (prpl_info && prpl_info->join_chat) |
335 prpl_info->join_chat(g, data); | 334 prpl_info->join_chat(g, data); |
336 } | 335 } |
337 | 336 |
338 | 337 |
339 void serv_reject_chat(GaimConnection *g, GHashTable *data) | 338 void serv_reject_chat(GaimConnection *g, GHashTable *data) |
341 GaimPluginProtocolInfo *prpl_info = NULL; | 340 GaimPluginProtocolInfo *prpl_info = NULL; |
342 | 341 |
343 if (g != NULL && g->prpl != NULL) | 342 if (g != NULL && g->prpl != NULL) |
344 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl); | 343 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl); |
345 | 344 |
346 if (prpl_info && g_list_find(gaim_connections_get_all(), g) && prpl_info->reject_chat) | 345 if (prpl_info && prpl_info->reject_chat) |
347 prpl_info->reject_chat(g, data); | 346 prpl_info->reject_chat(g, data); |
348 } | 347 } |
349 | 348 |
350 void serv_chat_invite(GaimConnection *g, int id, const char *message, const char *name) | 349 void serv_chat_invite(GaimConnection *g, int id, const char *message, const char *name) |
351 { | 350 { |
362 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl); | 361 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl); |
363 | 362 |
364 gaim_signal_emit(gaim_conversations_get_handle(), "chat-inviting-user", | 363 gaim_signal_emit(gaim_conversations_get_handle(), "chat-inviting-user", |
365 conv, name, &buffy); | 364 conv, name, &buffy); |
366 | 365 |
367 if (prpl_info && g_list_find(gaim_connections_get_all(), g) && prpl_info->chat_invite) | 366 if (prpl_info && prpl_info->chat_invite) |
368 prpl_info->chat_invite(g, id, buffy, name); | 367 prpl_info->chat_invite(g, id, buffy, name); |
369 | 368 |
370 gaim_signal_emit(gaim_conversations_get_handle(), "chat-invited-user", | 369 gaim_signal_emit(gaim_conversations_get_handle(), "chat-invited-user", |
371 conv, name, buffy); | 370 conv, name, buffy); |
372 | 371 |
380 */ | 379 */ |
381 | 380 |
382 void serv_chat_leave(GaimConnection *g, int id) | 381 void serv_chat_leave(GaimConnection *g, int id) |
383 { | 382 { |
384 GaimPluginProtocolInfo *prpl_info = NULL; | 383 GaimPluginProtocolInfo *prpl_info = NULL; |
385 | |
386 if (!g_list_find(gaim_connections_get_all(), g)) | |
387 return; | |
388 | 384 |
389 if (g->prpl != NULL) | 385 if (g->prpl != NULL) |
390 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl); | 386 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl); |
391 | 387 |
392 if (prpl_info && prpl_info->chat_leave) | 388 if (prpl_info && prpl_info->chat_leave) |