comparison src/savedstatuses.c @ 11739:a25be0e70a67

[gaim-migrate @ 14030] I changed the GtkStatusBox list stores to use an enum instead of a string to identify the items in the GtkStatusBox. This feels a lot cleaner to me committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 23 Oct 2005 06:46:07 +0000
parents ef511dec9903
children 7584d802f0ac
comparison
equal deleted inserted replaced
11738:992d49cf2b92 11739:a25be0e70a67
520 520
521 void 521 void
522 gaim_savedstatus_activate_for_account(const GaimSavedStatus *saved_status, 522 gaim_savedstatus_activate_for_account(const GaimSavedStatus *saved_status,
523 GaimAccount *account) 523 GaimAccount *account)
524 { 524 {
525 const GList *status_types;
526 GaimStatusType *status_type; 525 GaimStatusType *status_type;
527 526
528 g_return_if_fail(saved_status != NULL); 527 g_return_if_fail(saved_status != NULL);
529 g_return_if_fail(account != NULL); 528 g_return_if_fail(account != NULL);
530 529
531 /* Find the status type that matches the given primitive */ 530 status_type = gaim_account_get_status_type_with_primitive(account, saved_status->type);
532 status_types = gaim_account_get_status_types(account); 531
533 while (status_types != NULL) 532 if (status_type != NULL)
534 { 533 {
535 status_type = status_types->data; 534 if (saved_status->message != NULL)
536 if (gaim_status_type_get_primitive(status_type) == saved_status->type) 535 gaim_account_set_status(account, gaim_status_type_get_id(status_type),
537 { 536 TRUE, "message", saved_status->message, NULL);
538 if (saved_status->message != NULL) 537 else
539 gaim_account_set_status(account, gaim_status_type_get_id(status_type), 538 gaim_account_set_status(account, gaim_status_type_get_id(status_type),
540 TRUE, "message", saved_status->message, NULL); 539 TRUE, NULL);
541 else
542 gaim_account_set_status(account, gaim_status_type_get_id(status_type),
543 TRUE, NULL);
544 return;
545 }
546 status_types = status_types->next;
547 } 540 }
548 } 541 }
549 542
550 void * 543 void *
551 gaim_savedstatuses_get_handle(void) 544 gaim_savedstatuses_get_handle(void)