From: Eric W. <war...@us...> - 2001-10-17 20:24:14
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv10219 Modified Files: core.h list.c Log Message: hi Index: core.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/core.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- core.h 2001/10/15 19:52:44 1.9 +++ core.h 2001/10/17 20:24:11 1.10 @@ -149,7 +149,7 @@ extern void do_import(struct gaim_connection *, char *); extern int bud_list_cache_exists(struct gaim_connection *); extern void toc_build_config(struct gaim_connection *, char *, int len, gboolean); -extern void parse_toc_buddy_list(struct gaim_connection *, char *, int); +extern void parse_toc_buddy_list(struct gaim_connection *, char *); /* Functions in core.c */ extern gint UI_write(struct UI *, guchar *, int); Index: list.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/list.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- list.c 2001/09/28 07:46:36 1.1 +++ list.c 2001/10/17 20:24:11 1.2 @@ -331,7 +331,7 @@ } } -void parse_toc_buddy_list(struct gaim_connection *gc, char *config, int from_do_import) +void parse_toc_buddy_list(struct gaim_connection *gc, char *config) { char *c; char current[256]; @@ -352,8 +352,10 @@ break; if (*c == 'g') { strncpy(current, c + 2, sizeof(current)); - add_group(gc, current); - how_many++; + if (!find_group(gc, current)) { + add_group(gc, current); + how_many++; + } } else if (*c == 'b' && !find_buddy(gc, c + 2)) { char nm[80], sw[80], *tmp = c + 2; int i = 0; @@ -366,11 +368,11 @@ while (*tmp) sw[i++] = *tmp++; sw[i] = '\0'; - if (!find_buddy(gc, nm)) + if (!find_buddy(gc, nm)) { add_buddy(gc, current, nm, sw); - how_many++; - - bud = g_list_append(bud, c + 2); + how_many++; + bud = g_list_append(bud, c + 2); + } } else if (*c == 'p') { GSList *d = gc->permit; char *n; @@ -383,9 +385,10 @@ d = d->next; } g_free(n); - if (!d) + if (!d) { gc->permit = g_slist_append(gc->permit, name); - else + how_many++; + } else g_free(name); } else if (*c == 'd') { GSList *d = gc->deny; @@ -399,9 +402,10 @@ d = d->next; } g_free(n); - if (!d) + if (!d) { gc->deny = g_slist_append(gc->deny, name); - else + how_many++; + } else g_free(name); } else if (!strncmp("toc", c, 3)) { sscanf(c + strlen(c) - 1, "%d", &gc->permdeny); @@ -422,15 +426,9 @@ } serv_set_permit_deny(gc); } - - /* perhaps the server dropped the buddy list, try importing from - cache */ - if (how_many == 0 && !from_do_import) { - do_import(gc, NULL); - } else if (gc && (bud_list_cache_exists(gc) == FALSE)) { + if (how_many != 0) do_export(gc); - } } void toc_build_config(struct gaim_connection *gc, char *s, int len, gboolean show) @@ -727,7 +725,7 @@ return; } - parse_toc_buddy_list(gc, buf, 1); + parse_toc_buddy_list(gc, buf); fclose(f); |