changeset 4497:5968bcd8ddb6

[gaim-migrate @ 4772] OK, I think the reason we've been losing buddy lists (which with SSI makes it look like buddies are getting randomly moved) is that something is trying to write the blist.xml file before it is read. So we now check to make sure we've read the file before we allow any writes to happen. If anyone has any "randomly moving" buddies after this, please let me know. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Fri, 31 Jan 2003 21:56:58 +0000
parents 71e8b8e62a54
children 62e01447b647
files src/list.c
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/list.c	Fri Jan 31 21:33:04 2003 +0000
+++ b/src/list.c	Fri Jan 31 21:56:58 2003 +0000
@@ -720,6 +720,7 @@
 	return FALSE;
 }
 
+static gboolean blist_safe_to_write = FALSE;
 
 static char *blist_parser_group_name = NULL;
 static char *blist_parser_person_name = NULL;
@@ -986,10 +987,10 @@
 	char *filename;
 	char *msg;
 
-	if(!user_dir) {
-		debug_printf("unable to get user dir!  buddy list load aborted!\n");
+	blist_safe_to_write = TRUE;
+
+	if(!user_dir)
 		return;
-	}
 
 	filename = g_build_filename(user_dir, "blist.xml", NULL);
 
@@ -1113,6 +1114,11 @@
 	if(!user_dir)
 		return;
 
+	if(!blist_safe_to_write) {
+		debug_printf("AHH!! tried to write the blist before we read it!\n");
+		return;
+	}
+
 	file = fopen(user_dir, "r");
 	if(!file)
 		mkdir(user_dir, S_IRUSR | S_IWUSR | S_IXUSR);