changeset 2383:3d4bbadf4b8d

[gaim-migrate @ 2396] fixes committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Fri, 28 Sep 2001 08:51:46 +0000
parents 569ae9f2bb89
children 05034cd0402b
files src/gaimrc.c
diffstat 1 files changed, 19 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/gaimrc.c	Fri Sep 28 07:46:36 2001 +0000
+++ b/src/gaimrc.c	Fri Sep 28 08:51:46 2001 +0000
@@ -256,6 +256,12 @@
 			default_away = g_slist_nth_data(away_messages, atoi(p->value[1]));
 		}
 	}
+	if (!away_messages) {
+		a = g_new0(struct away_message, 1);
+		g_snprintf(a->name, sizeof(a->name), "boring default");
+		g_snprintf(a->message, sizeof(a->message), "%s", BORING_DEFAULT_AWAY_MSG);
+		away_messages = g_slist_append(away_messages, a);
+	}
 }
 
 static void gaimrc_write_away(FILE *f)
@@ -956,15 +962,7 @@
 static void set_defaults()
 {
 	int i;
-
-	if (aim_users) {
-		g_list_free(aim_users);
-		aim_users = NULL;
-	}
-	if (away_messages) {
-		g_slist_free(away_messages);
-		away_messages = NULL;
-	}
+	struct away_message *a;
 
 	misc_options =
 		OPT_MISC_BUDDY_TICKER |
@@ -1013,12 +1011,17 @@
 	    OPT_SOUND_RECV |
 	    OPT_SOUND_SEND |
 	    OPT_SOUND_SILENT_SIGNON;
+
 	report_idle = IDLE_SCREENSAVER;
 	web_browser = BROWSER_NETSCAPE;
+	g_snprintf(web_command, sizeof(web_command), "xterm -e lynx %%s");
+
 	auto_away = 10;
-	default_away = NULL;
-
-	g_snprintf(web_command, sizeof(web_command), "xterm -e lynx %%s");
+	a = g_new0(struct away_message, 1);
+	g_snprintf(a->name, sizeof(a->name), "boring default");
+	g_snprintf(a->message, sizeof(a->message), "%s", BORING_DEFAULT_AWAY_MSG);
+	away_messages = g_slist_append(away_messages, a);
+	default_away = a;
 
 	blist_pos.width = 0;
 	blist_pos.height = 0;
@@ -1096,6 +1099,10 @@
 	} else if (opt_rcfile_arg) {
 		g_snprintf(buf, sizeof(buf), _("Could not open config file %s."), opt_rcfile_arg);
 		do_error_dialog(buf, _("Preferences Error"));
+		set_defaults();
+	} else {
+		set_defaults();
+		save_prefs();
 	}
 }