diff src/status.c @ 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 f1f239fa8973
children eaec201b2688
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