Mercurial > pidgin
comparison libpurple/status.c @ 19114:6de2e9ba0930
merge of '2970edca111b3535ae0703e3c866ad1c3b87df94'
and 'a2b508e8680ac3f20965226a5dd83f7e2a3b15bb'
author | Eric Polino <aluink@pidgin.im> |
---|---|
date | Sun, 24 Jun 2007 02:56:09 +0000 |
parents | ab6d2763b8d8 |
children | 4b5fed5cb038 |
comparison
equal
deleted
inserted
replaced
19102:7f26e5b98b15 | 19114:6de2e9ba0930 |
---|---|
449 } | 449 } |
450 | 450 |
451 return NULL; | 451 return NULL; |
452 } | 452 } |
453 | 453 |
454 const GList * | 454 GList * |
455 purple_status_type_get_attrs(const PurpleStatusType *status_type) | 455 purple_status_type_get_attrs(const PurpleStatusType *status_type) |
456 { | 456 { |
457 g_return_val_if_fail(status_type != NULL, NULL); | 457 g_return_val_if_fail(status_type != NULL, NULL); |
458 | 458 |
459 return status_type->attrs; | 459 return status_type->attrs; |
546 **************************************************************************/ | 546 **************************************************************************/ |
547 PurpleStatus * | 547 PurpleStatus * |
548 purple_status_new(PurpleStatusType *status_type, PurplePresence *presence) | 548 purple_status_new(PurpleStatusType *status_type, PurplePresence *presence) |
549 { | 549 { |
550 PurpleStatus *status; | 550 PurpleStatus *status; |
551 const GList *l; | 551 GList *l; |
552 | 552 |
553 g_return_val_if_fail(status_type != NULL, NULL); | 553 g_return_val_if_fail(status_type != NULL, NULL); |
554 g_return_val_if_fail(presence != NULL, NULL); | 554 g_return_val_if_fail(presence != NULL, NULL); |
555 | 555 |
556 status = g_new0(PurpleStatus, 1); | 556 status = g_new0(PurpleStatus, 1); |
717 g_list_free(attrs); | 717 g_list_free(attrs); |
718 } | 718 } |
719 | 719 |
720 void | 720 void |
721 purple_status_set_active_with_attrs_list(PurpleStatus *status, gboolean active, | 721 purple_status_set_active_with_attrs_list(PurpleStatus *status, gboolean active, |
722 const GList *attrs) | 722 GList *attrs) |
723 { | 723 { |
724 gboolean changed = FALSE; | 724 gboolean changed = FALSE; |
725 const GList *l; | 725 GList *l; |
726 GList *specified_attr_ids = NULL; | 726 GList *specified_attr_ids = NULL; |
727 PurpleStatusType *status_type; | 727 PurpleStatusType *status_type; |
728 | 728 |
729 g_return_if_fail(status != NULL); | 729 g_return_if_fail(status != NULL); |
730 | 730 |
1166 g_hash_table_insert(presence->status_table, | 1166 g_hash_table_insert(presence->status_table, |
1167 g_strdup(purple_status_get_id(status)), status); | 1167 g_strdup(purple_status_get_id(status)), status); |
1168 } | 1168 } |
1169 | 1169 |
1170 void | 1170 void |
1171 purple_presence_add_list(PurplePresence *presence, const GList *source_list) | 1171 purple_presence_add_list(PurplePresence *presence, GList *source_list) |
1172 { | 1172 { |
1173 const GList *l; | 1173 GList *l; |
1174 | 1174 |
1175 g_return_if_fail(presence != NULL); | 1175 g_return_if_fail(presence != NULL); |
1176 g_return_if_fail(source_list != NULL); | 1176 g_return_if_fail(source_list != NULL); |
1177 | 1177 |
1178 for (l = source_list; l != NULL; l = l->next) | 1178 for (l = source_list; l != NULL; l = l->next) |
1394 PURPLE_PRESENCE_CONTEXT_BUDDY, NULL); | 1394 PURPLE_PRESENCE_CONTEXT_BUDDY, NULL); |
1395 | 1395 |
1396 return presence->u.buddy.buddy; | 1396 return presence->u.buddy.buddy; |
1397 } | 1397 } |
1398 | 1398 |
1399 const GList * | 1399 GList * |
1400 purple_presence_get_statuses(const PurplePresence *presence) | 1400 purple_presence_get_statuses(const PurplePresence *presence) |
1401 { | 1401 { |
1402 g_return_val_if_fail(presence != NULL, NULL); | 1402 g_return_val_if_fail(presence != NULL, NULL); |
1403 | 1403 |
1404 return presence->statuses; | 1404 return presence->statuses; |
1406 | 1406 |
1407 PurpleStatus * | 1407 PurpleStatus * |
1408 purple_presence_get_status(const PurplePresence *presence, const char *status_id) | 1408 purple_presence_get_status(const PurplePresence *presence, const char *status_id) |
1409 { | 1409 { |
1410 PurpleStatus *status; | 1410 PurpleStatus *status; |
1411 const GList *l = NULL; | 1411 GList *l = NULL; |
1412 | 1412 |
1413 g_return_val_if_fail(presence != NULL, NULL); | 1413 g_return_val_if_fail(presence != NULL, NULL); |
1414 g_return_val_if_fail(status_id != NULL, NULL); | 1414 g_return_val_if_fail(status_id != NULL, NULL); |
1415 | 1415 |
1416 /* What's the purpose of this hash table? */ | 1416 /* What's the purpose of this hash table? */ |
1485 | 1485 |
1486 gboolean | 1486 gboolean |
1487 purple_presence_is_status_primitive_active(const PurplePresence *presence, | 1487 purple_presence_is_status_primitive_active(const PurplePresence *presence, |
1488 PurpleStatusPrimitive primitive) | 1488 PurpleStatusPrimitive primitive) |
1489 { | 1489 { |
1490 const GList *l; | 1490 GList *l; |
1491 | 1491 |
1492 g_return_val_if_fail(presence != NULL, FALSE); | 1492 g_return_val_if_fail(presence != NULL, FALSE); |
1493 g_return_val_if_fail(primitive != PURPLE_STATUS_UNSET, FALSE); | 1493 g_return_val_if_fail(primitive != PURPLE_STATUS_UNSET, FALSE); |
1494 | 1494 |
1495 for (l = purple_presence_get_statuses(presence); | 1495 for (l = purple_presence_get_statuses(presence); |
1533 const PurplePresence *presence2) | 1533 const PurplePresence *presence2) |
1534 { | 1534 { |
1535 gboolean idle1, idle2; | 1535 gboolean idle1, idle2; |
1536 time_t idle_time_1, idle_time_2; | 1536 time_t idle_time_1, idle_time_2; |
1537 int score1 = 0, score2 = 0; | 1537 int score1 = 0, score2 = 0; |
1538 const GList *l; | 1538 GList *l; |
1539 | 1539 |
1540 if (presence1 == presence2) | 1540 if (presence1 == presence2) |
1541 return 0; | 1541 return 0; |
1542 else if (presence1 == NULL) | 1542 else if (presence1 == NULL) |
1543 return 1; | 1543 return 1; |