comparison src/gtkaccount.c @ 11295:ee1b890760be

[gaim-migrate @ 13495] Don't change the presence of an account when enabling or disabling the account. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 18 Aug 2005 04:57:47 +0000
parents 0c2d1b4b1351
children 10066662176a
comparison
equal deleted inserted replaced
11294:ad976105c306 11295:ee1b890760be
2109 gtk_tree_model_get_iter_from_string(model, &iter, path_str); 2109 gtk_tree_model_get_iter_from_string(model, &iter, path_str);
2110 gtk_tree_model_get(model, &iter, 2110 gtk_tree_model_get(model, &iter,
2111 COLUMN_DATA, &account, 2111 COLUMN_DATA, &account,
2112 COLUMN_ENABLED, &enabled, 2112 COLUMN_ENABLED, &enabled,
2113 -1); 2113 -1);
2114 if (enabled) {
2115 gaim_account_set_status(account, "offline", TRUE, NULL);
2116 } else {
2117 GaimGtkBuddyList *gtkblist;
2118 const char *type;
2119 GaimStatus *status;
2120 GaimStatusType *status_type;
2121
2122 gtkblist = gaim_gtk_blist_get_default_gtk_blist();
2123 type = gtk_gaim_status_box_get_active_type(GTK_GAIM_STATUS_BOX(gtkblist->statusbox));
2124 status = gaim_account_get_status(account, type);
2125 status_type = gaim_status_get_type(status);
2126
2127 if (gaim_status_type_get_attr(status_type, "message") != NULL)
2128 {
2129 const char *message;
2130 message = gtk_gaim_status_box_get_message(GTK_GAIM_STATUS_BOX(gtkblist->statusbox));
2131 gaim_account_set_status(account, type, TRUE, "message", message, NULL);
2132 }
2133 else
2134 {
2135 gaim_account_set_status(account, type, TRUE, NULL);
2136 }
2137 }
2138 2114
2139 gaim_account_set_enabled(account, GAIM_GTK_UI, !enabled); 2115 gaim_account_set_enabled(account, GAIM_GTK_UI, !enabled);
2140 2116
2141 gtk_list_store_set(dialog->model, &iter, 2117 gtk_list_store_set(dialog->model, &iter,
2142 COLUMN_ENABLED, !enabled, 2118 COLUMN_ENABLED, !enabled,