src/status.c

changeset 10151
e6c455f7ccf6
parent 10087
e5b80a38939d
child 10153
f4ce50e634d0
equal deleted inserted replaced
10150:90fb5d01bbf9 10151:e6c455f7ccf6
1442 const GList *l; 1442 const GList *l;
1443 1443
1444 if ((presence1 == NULL && presence2 == NULL) || (presence1 == presence2)) 1444 if ((presence1 == NULL && presence2 == NULL) || (presence1 == presence2))
1445 return 0; 1445 return 0;
1446 else if (presence1 == NULL) 1446 else if (presence1 == NULL)
1447 return 1;
1448 else if (presence2 == NULL)
1447 return -1; 1449 return -1;
1448 else if (presence2 == NULL)
1449 return 1;
1450 1450
1451 /* Compute the score of the first set of statuses. */ 1451 /* Compute the score of the first set of statuses. */
1452 for (l = gaim_presence_get_statuses(presence1); l != NULL; l = l->next) 1452 for (l = gaim_presence_get_statuses(presence1); l != NULL; l = l->next)
1453 { 1453 {
1454 GaimStatus *status = (GaimStatus *)l->data; 1454 GaimStatus *status = (GaimStatus *)l->data;
1457 if (gaim_status_is_active(status)) 1457 if (gaim_status_is_active(status))
1458 score1 += primitive_scores[gaim_status_type_get_primitive(type)]; 1458 score1 += primitive_scores[gaim_status_type_get_primitive(type)];
1459 } 1459 }
1460 1460
1461 /* Compute the score of the second set of statuses. */ 1461 /* Compute the score of the second set of statuses. */
1462 for (l = gaim_presence_get_statuses(presence1); l != NULL; l = l->next) 1462 for (l = gaim_presence_get_statuses(presence2); l != NULL; l = l->next)
1463 { 1463 {
1464 GaimStatus *status = (GaimStatus *)l->data; 1464 GaimStatus *status = (GaimStatus *)l->data;
1465 GaimStatusType *type = gaim_status_get_type(status); 1465 GaimStatusType *type = gaim_status_get_type(status);
1466 1466
1467 if (gaim_status_is_active(status)) 1467 if (gaim_status_is_active(status))

mercurial