| 1177 gnode = node->parent; |
1177 gnode = node->parent; |
| 1178 |
1178 |
| 1179 if (node->child) { |
1179 if (node->child) { |
| 1180 /* |
1180 /* |
| 1181 * If this contact has children then remove them. When the last |
1181 * If this contact has children then remove them. When the last |
| 1182 * buddy is removed from the contact, the contact is deleted. |
1182 * buddy is removed from the contact, the contact is automatically |
| |
1183 * deleted. |
| 1183 */ |
1184 */ |
| 1184 while (node->child) { |
1185 while (node->child->next) { |
| 1185 gaim_blist_remove_buddy((GaimBuddy*)node->child); |
1186 gaim_blist_remove_buddy((GaimBuddy*)node->child); |
| 1186 } |
1187 } |
| |
1188 /* |
| |
1189 * Remove the last buddy and trigger the deletion of the contact. |
| |
1190 * It would probably be cleaner if contact-deletion was done after |
| |
1191 * a timeout? Or if it had to be done manually, like below? |
| |
1192 */ |
| |
1193 gaim_blist_remove_buddy((GaimBuddy*)node->child); |
| 1187 } else { |
1194 } else { |
| 1188 /* Remove the node from its parent */ |
1195 /* Remove the node from its parent */ |
| 1189 if (gnode->child == node) |
1196 if (gnode->child == node) |
| 1190 gnode->child = node->next; |
1197 gnode->child = node->next; |
| 1191 if (node->prev) |
1198 if (node->prev) |