comparison src/prpl.c @ 12304:ae190d00b06d

[gaim-migrate @ 14608] This ensures the "account-status-changed" signal is always emitted, which makes the per-account status selectors show the correct status more accurately. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 03 Dec 2005 18:07:39 +0000
parents 6f41d8d33989
children b94069a95be7
comparison
equal deleted inserted replaced
12303:01f689cd7b49 12304:ae190d00b06d
273 gaim_blist_update_buddy_status(buddy, old_status); 273 gaim_blist_update_buddy_status(buddy, old_status);
274 } 274 }
275 g_slist_free(list); 275 g_slist_free(list);
276 } 276 }
277 277
278 void 278 static void
279 gaim_prpl_change_account_status(GaimAccount *account, 279 do_prpl_change_account_status(GaimAccount *account,
280 GaimStatus *old_status, GaimStatus *new_status) 280 GaimStatus *old_status, GaimStatus *new_status)
281 { 281 {
282 GaimPlugin *prpl; 282 GaimPlugin *prpl;
283 GaimPluginProtocolInfo *prpl_info; 283 GaimPluginProtocolInfo *prpl_info;
284
285 g_return_if_fail(account != NULL);
286 g_return_if_fail(old_status != NULL);
287 g_return_if_fail(new_status != NULL);
288 284
289 if (gaim_status_is_online(new_status) && 285 if (gaim_status_is_online(new_status) &&
290 gaim_account_is_disconnected(account)) 286 gaim_account_is_disconnected(account))
291 { 287 {
292 gaim_account_connect(account); 288 gaim_account_connect(account);
316 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); 312 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl);
317 313
318 if (prpl_info->set_status != NULL) 314 if (prpl_info->set_status != NULL)
319 { 315 {
320 prpl_info->set_status(account, new_status); 316 prpl_info->set_status(account, new_status);
321 gaim_signal_emit(gaim_accounts_get_handle(), "account-status-changed", 317 }
322 account, old_status, new_status); 318 }
323 } 319
320 void
321 gaim_prpl_change_account_status(GaimAccount *account,
322 GaimStatus *old_status, GaimStatus *new_status)
323 {
324 g_return_if_fail(account != NULL);
325 g_return_if_fail(old_status != NULL);
326 g_return_if_fail(new_status != NULL);
327
328 do_prpl_change_account_status(account, old_status, new_status);
329
330 gaim_signal_emit(gaim_accounts_get_handle(), "account-status-changed",
331 account, old_status, new_status);
324 } 332 }
325 333
326 GList * 334 GList *
327 gaim_prpl_get_statuses(GaimAccount *account, GaimPresence *presence) 335 gaim_prpl_get_statuses(GaimAccount *account, GaimPresence *presence)
328 { 336 {