| 61 PurpleBlistNode *gnode, *cnode, *bnode; |
61 PurpleBlistNode *gnode, *cnode, *bnode; |
| 62 |
62 |
| 63 gnode = (PurpleBlistNode *)group; |
63 gnode = (PurpleBlistNode *)group; |
| 64 |
64 |
| 65 for (cnode = gnode->child; cnode; cnode = cnode->next) { |
65 for (cnode = gnode->child; cnode; cnode = cnode->next) { |
| 66 if (PURPLE_IS_CHAT(cnode)) { |
66 if (PURPLE_IS_META_CONTACT(cnode)) { |
| 67 if (!g_slist_find(l, purple_chat_get_account(PURPLE_CHAT(cnode)))) |
|
| 68 l = g_slist_append(l, purple_chat_get_account(PURPLE_CHAT(cnode))); |
|
| 69 } else if (PURPLE_IS_META_CONTACT(cnode)) { |
|
| 70 for (bnode = cnode->child; bnode; bnode = bnode->next) { |
67 for (bnode = cnode->child; bnode; bnode = bnode->next) { |
| 71 if (PURPLE_IS_BUDDY(bnode)) { |
68 if (PURPLE_IS_BUDDY(bnode)) { |
| 72 if (!g_slist_find(l, purple_buddy_get_account(PURPLE_BUDDY(bnode)))) |
69 if (!g_slist_find(l, purple_buddy_get_account(PURPLE_BUDDY(bnode)))) |
| 73 l = g_slist_append(l, purple_buddy_get_account(PURPLE_BUDDY(bnode))); |
70 l = g_slist_append(l, purple_buddy_get_account(PURPLE_BUDDY(bnode))); |
| 74 } |
71 } |
| 82 gboolean purple_group_on_account(PurpleGroup *g, PurpleAccount *account) { |
79 gboolean purple_group_on_account(PurpleGroup *g, PurpleAccount *account) { |
| 83 PurpleBlistNode *cnode; |
80 PurpleBlistNode *cnode; |
| 84 for (cnode = ((PurpleBlistNode *)g)->child; cnode; cnode = cnode->next) { |
81 for (cnode = ((PurpleBlistNode *)g)->child; cnode; cnode = cnode->next) { |
| 85 if (PURPLE_IS_META_CONTACT(cnode)) { |
82 if (PURPLE_IS_META_CONTACT(cnode)) { |
| 86 if(purple_meta_contact_on_account((PurpleMetaContact *) cnode, account)) |
83 if(purple_meta_contact_on_account((PurpleMetaContact *) cnode, account)) |
| 87 return TRUE; |
|
| 88 } else if (PURPLE_IS_CHAT(cnode)) { |
|
| 89 PurpleChat *chat = (PurpleChat *)cnode; |
|
| 90 if ((!account && purple_account_is_connected(purple_chat_get_account(chat))) |
|
| 91 || purple_chat_get_account(chat) == account) |
|
| 92 return TRUE; |
84 return TRUE; |
| 93 } |
85 } |
| 94 } |
86 } |
| 95 return FALSE; |
87 return FALSE; |
| 96 } |
88 } |
| 143 purple_blist_add_buddy((PurpleBuddy *)bnode, (PurpleMetaContact *)child, |
135 purple_blist_add_buddy((PurpleBuddy *)bnode, (PurpleMetaContact *)child, |
| 144 NULL, bnode->prev); |
136 NULL, bnode->prev); |
| 145 moved_buddies = g_list_append(moved_buddies, bnode); |
137 moved_buddies = g_list_append(moved_buddies, bnode); |
| 146 } |
138 } |
| 147 prev = child; |
139 prev = child; |
| 148 } else if (PURPLE_IS_CHAT(child)) { |
|
| 149 purple_blist_add_chat((PurpleChat *)child, dest, prev); |
|
| 150 prev = child; |
|
| 151 } else { |
140 } else { |
| 152 purple_debug_error("blistnodetypes", "Unknown child type in group %s", priv->name); |
141 purple_debug_error("blistnodetypes", "Unknown child type in group %s", priv->name); |
| 153 } |
142 } |
| 154 child = next; |
143 child = next; |
| 155 } |
144 } |