changeset 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 2c8a9f9a71e6
children f948913f3c33
files src/account.c src/status.c src/status.h
diffstat 3 files changed, 42 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/account.c	Mon Sep 27 21:48:56 2004 +0000
+++ b/src/account.c	Mon Sep 27 22:05:27 2004 +0000
@@ -568,7 +568,7 @@
 		return;
 	}
 
-	if (!active && gaim_status_is_independent(status))
+	if (!active && gaim_status_is_exclusive(status))
 	{
 		gaim_debug(GAIM_DEBUG_ERROR, "accounts",
 				   "Cannot deactivate an exclusive status.\n");
--- a/src/status.c	Mon Sep 27 21:48:56 2004 +0000
+++ b/src/status.c	Mon Sep 27 22:05:27 2004 +0000
@@ -1,5 +1,5 @@
 /**
- * @file status.h Status API
+ * @file status.c Status API
  * @ingroup core
  *
  * gaim
@@ -372,6 +372,14 @@
 }
 
 gboolean
+gaim_status_type_is_exclusive(const GaimStatusType *status_type)
+{
+	g_return_val_if_fail(status_type != NULL, FALSE);
+
+	return !status_type->independent;
+}
+
+gboolean
 gaim_status_type_is_available(const GaimStatusType *status_type)
 {
 	GaimStatusPrimitive primitive;
@@ -619,7 +627,7 @@
 
 	status_type = gaim_status_get_type(status);
 
-	if (!active && !gaim_status_type_is_independent(status_type))
+	if (!active && gaim_status_type_is_exclusive(status_type))
 	{
 		gaim_debug_error("status",
 				   "Cannot deactivate an exclusive status (%s).\n",
@@ -630,7 +638,7 @@
 	presence   = gaim_status_get_presence(status);
 	old_status = gaim_presence_get_active_status(presence);
 
-	if (!gaim_status_type_is_independent(status_type))
+	if (gaim_status_type_is_exclusive(status_type))
 	{
 		const GList *l;
 
@@ -773,6 +781,14 @@
 }
 
 gboolean
+gaim_status_is_exclusive(const GaimStatus *status)
+{
+	g_return_val_if_fail(status != NULL, FALSE);
+
+	return gaim_status_type_is_exclusive(gaim_status_get_type(status));
+}
+
+gboolean
 gaim_status_is_available(const GaimStatus *status)
 {
 	g_return_val_if_fail(status != NULL, FALSE);
@@ -1080,7 +1096,7 @@
 
 	g_return_if_fail(status != NULL);
 
-	if (!gaim_status_is_independent(status))
+	if (gaim_status_is_exclusive(status))
 	{
 		if (!active)
 		{
--- a/src/status.h	Mon Sep 27 21:48:56 2004 +0000
+++ b/src/status.h	Mon Sep 27 22:05:27 2004 +0000
@@ -246,6 +246,15 @@
 gboolean gaim_status_type_is_independent(const GaimStatusType *status_type);
 
 /**
+ * Returns whether or not the status type is exlusive.
+ *
+ * @param status_type The status type.
+ *
+ * @return TRUE if the status type is exclusive, FALSE otherwise.
+ */
+gboolean gaim_status_type_is_exclusive(const GaimStatusType *status_type);
+
+/**
  * Returns whether or not a status type is available.
  *
  * Available status types are online and possibly hidden, but not away.
@@ -458,6 +467,18 @@
 gboolean gaim_status_is_independent(const GaimStatus *status);
 
 /**
+ * Returns whether or not a status is exclusive.
+ *
+ * This is a convenience method for
+ * gaim_status_type_is_exclusive(gaim_status_get_type(status)).
+ *
+ * @param status The status.
+ *
+ * @return TRUE if the status is exclusive, FALSE otherwise.
+ */
+gboolean gaim_status_is_exclusive(const GaimStatus *status);
+
+/**
  * Returns whether or not a status is available.
  *
  * Available statuses are online and possibly hidden, but not away or idle.