diff src/toc.c @ 228:f3b61c04f44e

[gaim-migrate @ 238] Buddy lists (and changes) are cached to ~/.gaimbdcache_<sn> where <sn> is your screen name (folder to uppercase). If for some reason, you log into the AOL server and the buddy list comes back empty, we check for a cache file, and, if we find one, read it in. This essentially implements recovery from a server crash at AOL (AOL does not back up machines that contain TOC-based buddy lists, unfortunately). committer: Tailor Script <tailor@pidgin.im>
author Syd Logan <slogan>
date Wed, 10 May 2000 07:41:25 +0000
parents fba779cc01f5
children e8ea7f37e28f
line wrap: on
line diff
--- 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 );
+	}
  }