| 2169 { |
2169 { |
| 2170 const char *s1, *s2; |
2170 const char *s1, *s2; |
| 2171 char *us1, *us2; |
2171 char *us1, *us2; |
| 2172 int ret; |
2172 int ret; |
| 2173 |
2173 |
| 2174 if (n1->type != n2->type) |
2174 if (purple_blist_node_get_type(n1) != purple_blist_node_get_type(n2)) |
| 2175 return blist_node_compare_position(n1, n2); |
2175 return blist_node_compare_position(n1, n2); |
| 2176 |
2176 |
| 2177 switch (n1->type) |
2177 switch (purple_blist_node_get_type(n1)) |
| 2178 { |
2178 { |
| 2179 case PURPLE_BLIST_CHAT_NODE: |
2179 case PURPLE_BLIST_CHAT_NODE: |
| 2180 s1 = purple_chat_get_name((PurpleChat*)n1); |
2180 s1 = purple_chat_get_name((PurpleChat*)n1); |
| 2181 s2 = purple_chat_get_name((PurpleChat*)n2); |
2181 s2 = purple_chat_get_name((PurpleChat*)n2); |
| 2182 break; |
2182 break; |
| 2204 static int |
2204 static int |
| 2205 blist_node_compare_status(PurpleBlistNode *n1, PurpleBlistNode *n2) |
2205 blist_node_compare_status(PurpleBlistNode *n1, PurpleBlistNode *n2) |
| 2206 { |
2206 { |
| 2207 int ret; |
2207 int ret; |
| 2208 |
2208 |
| 2209 if (n1->type != n2->type) |
2209 if (purple_blist_node_get_type(n1) != purple_blist_node_get_type(n2)) |
| 2210 return blist_node_compare_position(n1, n2); |
2210 return blist_node_compare_position(n1, n2); |
| 2211 |
2211 |
| 2212 switch (n1->type) { |
2212 switch (purple_blist_node_get_type(n1)) { |
| 2213 case PURPLE_BLIST_CONTACT_NODE: |
2213 case PURPLE_BLIST_CONTACT_NODE: |
| 2214 n1 = (PurpleBlistNode*)purple_contact_get_priority_buddy((PurpleContact*)n1); |
2214 n1 = (PurpleBlistNode*)purple_contact_get_priority_buddy((PurpleContact*)n1); |
| 2215 n2 = (PurpleBlistNode*)purple_contact_get_priority_buddy((PurpleContact*)n2); |
2215 n2 = (PurpleBlistNode*)purple_contact_get_priority_buddy((PurpleContact*)n2); |
| 2216 /* now compare the presence of the priority buddies */ |
2216 /* now compare the presence of the priority buddies */ |
| 2217 case PURPLE_BLIST_BUDDY_NODE: |
2217 case PURPLE_BLIST_BUDDY_NODE: |
| 2249 blist_node_compare_log(PurpleBlistNode *n1, PurpleBlistNode *n2) |
2249 blist_node_compare_log(PurpleBlistNode *n1, PurpleBlistNode *n2) |
| 2250 { |
2250 { |
| 2251 int ret; |
2251 int ret; |
| 2252 PurpleBuddy *b1, *b2; |
2252 PurpleBuddy *b1, *b2; |
| 2253 |
2253 |
| 2254 if (n1->type != n2->type) |
2254 if (purple_blist_node_get_type(n1) != purple_blist_node_get_type(n2)) |
| 2255 return blist_node_compare_position(n1, n2); |
2255 return blist_node_compare_position(n1, n2); |
| 2256 |
2256 |
| 2257 switch (n1->type) { |
2257 switch (purple_blist_node_get_type(n1)) { |
| 2258 case PURPLE_BLIST_BUDDY_NODE: |
2258 case PURPLE_BLIST_BUDDY_NODE: |
| 2259 b1 = (PurpleBuddy*)n1; |
2259 b1 = (PurpleBuddy*)n1; |
| 2260 b2 = (PurpleBuddy*)n2; |
2260 b2 = (PurpleBuddy*)n2; |
| 2261 ret = purple_log_get_total_size(PURPLE_LOG_IM, b2->name, b2->account) - |
2261 ret = purple_log_get_total_size(PURPLE_LOG_IM, b2->name, b2->account) - |
| 2262 purple_log_get_total_size(PURPLE_LOG_IM, b1->name, b1->account); |
2262 purple_log_get_total_size(PURPLE_LOG_IM, b1->name, b1->account); |