# HG changeset patch # User Luke Schierer # Date 1095549458 0 # Node ID 81059dce3aedd0ed4dc046102417495a98e70e60 # Parent cf02e7104706da8d208981a0078c330ebbf52014 [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 diff -r cf02e7104706 -r 81059dce3aed src/status.c --- 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 diff -r cf02e7104706 -r 81059dce3aed src/status.h --- 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.