changeset 10040:81059dce3aed

[gaim-migrate @ 10999] " Post all three of these to the sf patch tracker as three separate patches and assign the buddy list changes and oscar changes to me, and the gaim_status_is_online() changes to Luke. And in the one assigned to Luke, ask him if he could pretty please with sugar on top check through it quickly and commit it if it looks sensible? --KingAnt This adds gaim_status_is_online so that we can check statuses as well as presences for online status. It also changes gaim_presence_is_online to use the new function." --Dave West committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Sat, 18 Sep 2004 23:17:38 +0000
parents cf02e7104706
children e6a3aa978a44
files src/status.c src/status.h
diffstat 2 files changed, 23 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/status.c	Sat Sep 18 23:17:18 2004 +0000
+++ b/src/status.c	Sat Sep 18 23:17:38 2004 +0000
@@ -794,6 +794,19 @@
 	return status->active;
 }
 
+gboolean
+gaim_status_is_online(const GaimStatus *status)
+{
+	GaimStatusPrimitive primitive;
+
+	g_return_val_if_fail( status != NULL, FALSE);
+
+	primitive = gaim_status_type_get_primitive(gaim_status_get_type(status));
+
+	return (primitive != GAIM_STATUS_UNSET &&
+			primitive != GAIM_STATUS_OFFLINE);
+}
+
 GaimValue *
 gaim_status_get_attr_value(const GaimStatus *status, const char *id)
 {
@@ -1345,17 +1358,13 @@
 gaim_presence_is_online(const GaimPresence *presence)
 {
 	GaimStatus *status;
-	GaimStatusPrimitive primitive;
 
 	g_return_val_if_fail(presence != NULL, FALSE);
 
 	if ((status = gaim_presence_get_active_status(presence)) == NULL)
 		return FALSE;
 
-	primitive = gaim_status_type_get_primitive(gaim_status_get_type(status));
-
-	return (primitive != GAIM_STATUS_UNSET &&
-			primitive != GAIM_STATUS_OFFLINE);
+	return gaim_status_is_online(status);
 }
 
 gboolean
--- a/src/status.h	Sat Sep 18 23:17:18 2004 +0000
+++ b/src/status.h	Sat Sep 18 23:17:38 2004 +0000
@@ -481,6 +481,15 @@
 gboolean gaim_status_is_active(const GaimStatus *status);
 
 /**
+ * Returns whether or not a status is considered 'online'
+ *
+ * @param status The status.
+ *
+ * @return TRUE if the status is considered online, FALSE otherwise
+ */
+gboolean gaim_status_is_online(const GaimStatus *status);
+
+/**
  * Returns the value of an attribute in a status with the specified ID.
  *
  * @param status The status.