From: Eric W. <war...@us...> - 2001-10-24 10:23:52
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv20366/src Modified Files: core.h list.c multi.c Log Message: you're the one that i want (you're the one i wa-ant) oo oo oo you're all i need oh yes indeed Index: core.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/core.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- core.h 2001/10/17 20:24:11 1.10 +++ core.h 2001/10/24 10:23:48 1.11 @@ -150,6 +150,7 @@ 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 *); +extern void signoff_blocked(struct gaim_connection *); /* 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.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- list.c 2001/10/23 20:56:24 1.6 +++ list.c 2001/10/24 10:23:48 1.7 @@ -775,3 +775,63 @@ g_free(g_screenname); g_free(file); } + +static gboolean is_blocked(struct buddy *b) +{ + struct gaim_connection *gc = b->gc; + + if (gc->permdeny == PERMIT_ALL) + return FALSE; + + if (gc->permdeny == PERMIT_NONE) { + if (g_strcasecmp(b->name, gc->displayname)) + return TRUE; + else + return FALSE; + } + + if (gc->permdeny == PERMIT_SOME) { + char *x = g_strdup(normalize(b->name)); + GSList *s = gc->permit; + while (s) { + if (!g_strcasecmp(x, normalize(s->data))) + break; + s = s->next; + } + g_free(x); + if (s) + return FALSE; + return TRUE; + } + + if (gc->permdeny == DENY_SOME) { + char *x = g_strdup(normalize(b->name)); + GSList *s = gc->deny; + while (s) { + if (!g_strcasecmp(x, normalize(s->data))) + break; + s = s->next; + } + g_free(x); + if (s) + return TRUE; + return FALSE; + } + + return FALSE; +} + +void signoff_blocked(struct gaim_connection *gc) +{ + GSList *g = gc->groups; + while (g) { + GSList *m = ((struct group *)g->data)->members; + while (m) { + struct buddy *b = m->data; + if (is_blocked(b)) + serv_got_update(gc, b->name, 0, 0, 0, 0, 0, 0); + m = m->next; + } + g = g->next; + } +} Index: multi.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/multi.c,v retrieving revision 1.96 retrieving revision 1.97 diff -u -d -r1.96 -r1.97 --- multi.c 2001/10/21 19:49:20 1.96 +++ multi.c 2001/10/24 10:23:48 1.97 @@ -107,6 +107,16 @@ } g_free(m); } + g = gc->permit; + while (g) { + g_free(g->data); + g = g_slist_remove(g, g->data); + } + g = gc->deny; + while (g) { + g_free(g->data); + g = g_slist_remove(g, g->data); + } g_free(gc); #ifndef USE_APPLET if (!connections && mainwindow) |