comparison 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
comparison
equal deleted inserted replaced
10039:cf02e7104706 10040:81059dce3aed
792 g_return_val_if_fail(status != NULL, FALSE); 792 g_return_val_if_fail(status != NULL, FALSE);
793 793
794 return status->active; 794 return status->active;
795 } 795 }
796 796
797 gboolean
798 gaim_status_is_online(const GaimStatus *status)
799 {
800 GaimStatusPrimitive primitive;
801
802 g_return_val_if_fail( status != NULL, FALSE);
803
804 primitive = gaim_status_type_get_primitive(gaim_status_get_type(status));
805
806 return (primitive != GAIM_STATUS_UNSET &&
807 primitive != GAIM_STATUS_OFFLINE);
808 }
809
797 GaimValue * 810 GaimValue *
798 gaim_status_get_attr_value(const GaimStatus *status, const char *id) 811 gaim_status_get_attr_value(const GaimStatus *status, const char *id)
799 { 812 {
800 GaimStatusType *status_type; 813 GaimStatusType *status_type;
801 GaimStatusAttr *attr; 814 GaimStatusAttr *attr;
1343 1356
1344 gboolean 1357 gboolean
1345 gaim_presence_is_online(const GaimPresence *presence) 1358 gaim_presence_is_online(const GaimPresence *presence)
1346 { 1359 {
1347 GaimStatus *status; 1360 GaimStatus *status;
1348 GaimStatusPrimitive primitive;
1349 1361
1350 g_return_val_if_fail(presence != NULL, FALSE); 1362 g_return_val_if_fail(presence != NULL, FALSE);
1351 1363
1352 if ((status = gaim_presence_get_active_status(presence)) == NULL) 1364 if ((status = gaim_presence_get_active_status(presence)) == NULL)
1353 return FALSE; 1365 return FALSE;
1354 1366
1355 primitive = gaim_status_type_get_primitive(gaim_status_get_type(status)); 1367 return gaim_status_is_online(status);
1356
1357 return (primitive != GAIM_STATUS_UNSET &&
1358 primitive != GAIM_STATUS_OFFLINE);
1359 } 1368 }
1360 1369
1361 gboolean 1370 gboolean
1362 gaim_presence_is_status_active(const GaimPresence *presence, 1371 gaim_presence_is_status_active(const GaimPresence *presence,
1363 const char *status_id) 1372 const char *status_id)