diff src/gtkaccount.c @ 11724:a8ec0a291d14

[gaim-migrate @ 14015] If you're online, and sitting around, and la-di-da you enable one of your accounts, it will now use the status currently set in your gtkstatusbox instead of whatever the account was set to when it was disabled committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 22 Oct 2005 22:29:40 +0000
parents bf6ba37db13b
children ef511dec9903
line wrap: on
line diff
--- a/src/gtkaccount.c	Sat Oct 22 22:13:19 2005 +0000
+++ b/src/gtkaccount.c	Sat Oct 22 22:29:40 2005 +0000
@@ -35,6 +35,7 @@
 #include "prefs.h"
 #include "prpl.h"
 #include "request.h"
+#include "savedstatuses.h"
 #include "signals.h"
 #include "util.h"
 
@@ -2129,6 +2130,8 @@
 	GtkTreeModel *model = GTK_TREE_MODEL(dialog->model);
 	GtkTreeIter iter;
 	gboolean enabled;
+	const char *current_savedstatus_name;
+	const GaimSavedStatus *saved_status;
 
 	gtk_tree_model_get_iter_from_string(model, &iter, path_str);
 	gtk_tree_model_get(model, &iter,
@@ -2136,20 +2139,11 @@
 					   COLUMN_ENABLED, &enabled,
 					   -1);
 
-	/* TODO: Set the statuses for this account to match the GtkStatusBox */
-	/*
-	GtkWidget *blist;
-	GtkWidget *statusbox;
-	GaimStatus *status;
-
-	blist = gaim_gtk_blist_get_default_gtk_blist();
-	statusbox = blist->statusbox;
-	status = gaim_gtk_status_box_get_current_status();
-
-	gaim_account_set_status(account, );
-	gaim_account_set_status_vargs(account, );
-	gaim_account_set_status_list(account, );
-	*/
+	/* Set the statuses for this account to the current status */
+	current_savedstatus_name = gaim_prefs_get_string("/core/status/current");
+	saved_status = gaim_savedstatus_find(current_savedstatus_name);
+	gaim_savedstatus_activate_for_account(saved_status, account);
+
 	gaim_account_set_enabled(account, GAIM_GTK_UI, !enabled);
 
 	gtk_list_store_set(dialog->model, &iter,