Mercurial > pidgin.yaz
comparison src/status.c @ 10067:39142bdd5ba6
[gaim-migrate @ 11043]
This is sf patch 1031460, Added gaim_status_[type_]is_exclusive
So we can do
gaim_status_type_is_exlusive(status_type)
instead of
!gaim_status_type_is_independent(status_type)
Also, I'll be out of town all next week, starting Saturday (not that
it'll matter, I've barely had any Gaim-time the last week or two)
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Mon, 27 Sep 2004 22:05:27 +0000 |
parents | b566449d45f8 |
children | 0fb9cf6b9240 |
comparison
equal
deleted
inserted
replaced
10066:2c8a9f9a71e6 | 10067:39142bdd5ba6 |
---|---|
1 /** | 1 /** |
2 * @file status.h Status API | 2 * @file status.c Status API |
3 * @ingroup core | 3 * @ingroup core |
4 * | 4 * |
5 * gaim | 5 * gaim |
6 * | 6 * |
7 * Gaim is the legal property of its developers, whose names are too numerous | 7 * Gaim is the legal property of its developers, whose names are too numerous |
370 | 370 |
371 return status_type->independent; | 371 return status_type->independent; |
372 } | 372 } |
373 | 373 |
374 gboolean | 374 gboolean |
375 gaim_status_type_is_exclusive(const GaimStatusType *status_type) | |
376 { | |
377 g_return_val_if_fail(status_type != NULL, FALSE); | |
378 | |
379 return !status_type->independent; | |
380 } | |
381 | |
382 gboolean | |
375 gaim_status_type_is_available(const GaimStatusType *status_type) | 383 gaim_status_type_is_available(const GaimStatusType *status_type) |
376 { | 384 { |
377 GaimStatusPrimitive primitive; | 385 GaimStatusPrimitive primitive; |
378 | 386 |
379 g_return_val_if_fail(status_type != NULL, FALSE); | 387 g_return_val_if_fail(status_type != NULL, FALSE); |
617 if (status->active == active) | 625 if (status->active == active) |
618 return; | 626 return; |
619 | 627 |
620 status_type = gaim_status_get_type(status); | 628 status_type = gaim_status_get_type(status); |
621 | 629 |
622 if (!active && !gaim_status_type_is_independent(status_type)) | 630 if (!active && gaim_status_type_is_exclusive(status_type)) |
623 { | 631 { |
624 gaim_debug_error("status", | 632 gaim_debug_error("status", |
625 "Cannot deactivate an exclusive status (%s).\n", | 633 "Cannot deactivate an exclusive status (%s).\n", |
626 gaim_status_type_get_id(status_type)); | 634 gaim_status_type_get_id(status_type)); |
627 return; | 635 return; |
628 } | 636 } |
629 | 637 |
630 presence = gaim_status_get_presence(status); | 638 presence = gaim_status_get_presence(status); |
631 old_status = gaim_presence_get_active_status(presence); | 639 old_status = gaim_presence_get_active_status(presence); |
632 | 640 |
633 if (!gaim_status_type_is_independent(status_type)) | 641 if (gaim_status_type_is_exclusive(status_type)) |
634 { | 642 { |
635 const GList *l; | 643 const GList *l; |
636 | 644 |
637 for (l = gaim_presence_get_statuses(presence); l != NULL; l = l->next) | 645 for (l = gaim_presence_get_statuses(presence); l != NULL; l = l->next) |
638 { | 646 { |
771 | 779 |
772 return gaim_status_type_is_independent(gaim_status_get_type(status)); | 780 return gaim_status_type_is_independent(gaim_status_get_type(status)); |
773 } | 781 } |
774 | 782 |
775 gboolean | 783 gboolean |
784 gaim_status_is_exclusive(const GaimStatus *status) | |
785 { | |
786 g_return_val_if_fail(status != NULL, FALSE); | |
787 | |
788 return gaim_status_type_is_exclusive(gaim_status_get_type(status)); | |
789 } | |
790 | |
791 gboolean | |
776 gaim_status_is_available(const GaimStatus *status) | 792 gaim_status_is_available(const GaimStatus *status) |
777 { | 793 { |
778 g_return_val_if_fail(status != NULL, FALSE); | 794 g_return_val_if_fail(status != NULL, FALSE); |
779 | 795 |
780 return gaim_status_type_is_available(gaim_status_get_type(status)); | 796 return gaim_status_type_is_available(gaim_status_get_type(status)); |
1078 | 1094 |
1079 status = gaim_presence_get_status(presence, status_id); | 1095 status = gaim_presence_get_status(presence, status_id); |
1080 | 1096 |
1081 g_return_if_fail(status != NULL); | 1097 g_return_if_fail(status != NULL); |
1082 | 1098 |
1083 if (!gaim_status_is_independent(status)) | 1099 if (gaim_status_is_exclusive(status)) |
1084 { | 1100 { |
1085 if (!active) | 1101 if (!active) |
1086 { | 1102 { |
1087 gaim_debug_warning("status", | 1103 gaim_debug_warning("status", |
1088 "Attempted to set a non-independent status " | 1104 "Attempted to set a non-independent status " |