src/toc.c

changeset 228
ec61b2223b34
parent 217
dedec2ec6dea
child 229
1a1b2ea8dbd1
--- a/src/toc.c	Wed May 10 07:37:56 2000 +0000
+++ b/src/toc.c	Wed May 10 07:41:25 2000 +0000
@@ -849,13 +849,14 @@
         char current[256];
 	char *name;
 	GList *bud;
+	int how_many = 0;
+
         /* Clean out the permit/deny list!*/
         g_list_free(permit);
         g_list_free(deny);
         permit = NULL;
 	deny = NULL;
 	bud = NULL;
-
         
         /* skip "CONFIG:" (if it exists)*/
 
@@ -868,8 +869,10 @@
 		if (*c == 'g') {
 			strncpy(current,c+2, sizeof(current));
 			add_group(current);
+			how_many++;
 		} else if (*c == 'b') {
 			add_buddy(current, c+2);
+			how_many++;
 			bud = g_list_append(bud, c+2);
         } else if (*c == 'p') {
             name = g_malloc(strlen(c+2) + 2);
@@ -888,7 +891,14 @@
 #if 0
 	fprintf(stdout, "Sending message '%s'\n",buf);
 #endif
-       
+      
 	serv_add_buddies(bud);
         serv_set_permit_deny();
+
+	/* perhaps the server dropped the buddy list, try importing from
+           cache */
+
+	if ( how_many == 0 ) {
+		do_import( (GtkWidget *) NULL, 0 );
+	}
  }

mercurial