comparison src/multi.c @ 4785:1e28e7d802a1

[gaim-migrate @ 5105] fix a few things, get rid of a few stale functions, and get rid of the compatibility functions. wee! committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sat, 15 Mar 2003 03:23:30 +0000
parents 85c6c3a60503
children 0ed37c803503
comparison
equal deleted inserted replaced
4784:b1365291f002 4785:1e28e7d802a1
152 gint active_count; 152 gint active_count;
153 } *meter_win = NULL; 153 } *meter_win = NULL;
154 154
155 void destroy_gaim_conn(struct gaim_connection *gc) 155 void destroy_gaim_conn(struct gaim_connection *gc)
156 { 156 {
157 GSList *g = gaim_blist_groups(), *g1 = g; 157 GaimBlistNode *gnode,*bnode;
158 GSList *h, *h1;
159 struct group *m; 158 struct group *m;
160 struct buddy *n; 159 struct buddy *n;
161 while (g1) { 160 for(gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) {
162 m = (struct group *)g1->data; 161 if(!GAIM_BLIST_NODE_IS_GROUP(gnode))
163 g1 = g_slist_next(g1); 162 continue;
164 h1 = h = gaim_blist_members(m); 163 m = (struct group *)gnode;
165 while (h1) { 164 for(bnode = gnode->child; bnode; bnode = bnode->next) {
166 n = (struct buddy *)h1->data; 165 if(!GAIM_BLIST_NODE_IS_BUDDY(bnode))
167 h1 = g_slist_next(h1); 166 continue;
167 n = (struct buddy *)bnode;
168 if(n->account == gc->account) { 168 if(n->account == gc->account) {
169 n->present = 0; 169 n->present = 0;
170 } 170 }
171 } 171 }
172 g_slist_free(h); 172 }
173 }
174 g_slist_free(g);
175 g_free(gc->away); 173 g_free(gc->away);
176 g_free(gc->away_state); 174 g_free(gc->away_state);
177 g_free(gc); 175 g_free(gc);
178 176
179 if (!connections && mainwindow) 177 if (!connections && mainwindow)
1312 } 1310 }
1313 1311
1314 static void do_del_acct(struct gaim_account *account) 1312 static void do_del_acct(struct gaim_account *account)
1315 { 1313 {
1316 GtkTreeIter iter; 1314 GtkTreeIter iter;
1317 GSList *grps1, *grps, *buds; 1315 GaimBlistNode *gnode,*bnode;
1318 grps1 = grps = gaim_blist_groups();
1319 1316
1320 if (account->gc) { 1317 if (account->gc) {
1321 account->gc->wants_to_die = TRUE; 1318 account->gc->wants_to_die = TRUE;
1322 signoff(account->gc); 1319 signoff(account->gc);
1323 } 1320 }
1326 gtk_list_store_remove(GTK_LIST_STORE(model), &iter); 1323 gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
1327 } 1324 }
1328 1325
1329 1326
1330 /* remove the buddies for the account we just destroyed */ 1327 /* remove the buddies for the account we just destroyed */
1331 while(grps1) { 1328 for(gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) {
1332 struct group *g = grps1->data; 1329 struct group *g = (struct group *)gnode;
1333 GSList *buds1, *buds = gaim_blist_members(g); 1330 if(!GAIM_BLIST_NODE_IS_GROUP(gnode))
1334 buds1 = buds; 1331 continue;
1335 grps1 = grps1->next; 1332 for(bnode = gnode->child; bnode; bnode = bnode->next) {
1336 while(buds1) { 1333 struct buddy *b = (struct buddy *)bnode;
1337 struct buddy *b = buds1->data; 1334 if(!GAIM_BLIST_NODE_IS_BUDDY(bnode))
1338 buds1 = buds1->next; 1335 continue;
1339 if(b->account == account) { 1336 if(b->account == account) {
1340 gaim_blist_remove_buddy(b); 1337 gaim_blist_remove_buddy(b);
1341 } 1338 }
1342 } 1339 }
1343 g_slist_free(buds); 1340 if(!gnode->child) {
1344 if(!((GaimBlistNode*)g)->child) {
1345 gaim_blist_remove_group(g); 1341 gaim_blist_remove_group(g);
1346 } 1342 }
1347 } 1343 }
1348 g_slist_free(grps);
1349 1344
1350 gaim_accounts = g_slist_remove(gaim_accounts, account); 1345 gaim_accounts = g_slist_remove(gaim_accounts, account);
1351 1346
1352 gaim_blist_save(); 1347 gaim_blist_save();
1353 1348
1520 void account_online(struct gaim_connection *gc) 1515 void account_online(struct gaim_connection *gc)
1521 { 1516 {
1522 struct signon_meter *meter = find_signon_meter(gc); 1517 struct signon_meter *meter = find_signon_meter(gc);
1523 GList *wins; 1518 GList *wins;
1524 GtkTreeIter iter; 1519 GtkTreeIter iter;
1525 GSList *grps, *grps1, *buds, *buds1; 1520 GaimBlistNode *gnode,*bnode;
1526 GList *add_buds=NULL; 1521 GList *add_buds=NULL;
1527 GList *l; 1522 GList *l;
1528 1523
1529 /* Set the time the account came online */ 1524 /* Set the time the account came online */
1530 time(&gc->login_time); 1525 time(&gc->login_time);
1577 g_free(opt_away_arg); 1572 g_free(opt_away_arg);
1578 opt_away_arg = NULL; 1573 opt_away_arg = NULL;
1579 } 1574 }
1580 1575
1581 /* let the prpl know what buddies we pulled out of the local list */ 1576 /* let the prpl know what buddies we pulled out of the local list */
1582 grps = gaim_blist_groups(); 1577 for(gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) {
1583 for(grps1 = grps; grps1; grps1 = grps1->next) { 1578 if(!GAIM_BLIST_NODE_IS_GROUP(gnode))
1584 struct group *g = grps1->data; 1579 continue;
1585 buds = gaim_blist_members(g); 1580 for(bnode = gnode->child; bnode; bnode = bnode->next) {
1586 for(buds1 = buds; buds1; buds1 = buds1->next) { 1581 struct buddy *b = (struct buddy *)bnode;
1587 struct buddy *b = buds1->data; 1582 if(!GAIM_BLIST_NODE_IS_BUDDY(bnode))
1583 continue;
1588 if(b->account == gc->account) { 1584 if(b->account == gc->account) {
1589 add_buds = g_list_append(add_buds, b->name); 1585 add_buds = g_list_append(add_buds, b->name);
1590 } 1586 }
1591 } 1587 }
1592 g_slist_free(buds); 1588 }
1593 }
1594 g_slist_free(grps);
1595 1589
1596 if(add_buds) { 1590 if(add_buds) {
1597 serv_add_buddies(gc, add_buds); 1591 serv_add_buddies(gc, add_buds);
1598 g_list_free(add_buds); 1592 g_list_free(add_buds);
1599 } 1593 }