#include <gtk/gtk.h>
#include <glade/glade.h>
+#include <libmissioncontrol/mc-profile.h>
+
#include <libempathy/gossip-utils.h>
#include "gossip-account-widget-jabber.h"
str = gtk_entry_get_text (GTK_ENTRY (widget));
if (G_STR_EMPTY (str)) {
- gchar *value;
+ gchar *value = NULL;
mc_account_get_param_string (settings->account, param, &value);
gtk_entry_set_text (GTK_ENTRY (widget), value ? value : "");
GossipAccountWidgetJabber *settings)
{
if (widget == settings->checkbutton_ssl) {
- gint port;
+ gint port = 0;
gboolean old_ssl;
mc_account_get_param_int (settings->account, "port", &port);
static void
account_widget_jabber_setup (GossipAccountWidgetJabber *settings)
{
- gint port;
- gchar *id;
- gchar *resource;
- gchar *server;
- gchar *password;
- gboolean old_ssl;
+ gint port = 0;
+ gchar *id = NULL;
+ gchar *resource = NULL;
+ gchar *server = NULL;
+ gchar *password = NULL;
+ gboolean old_ssl = FALSE;
mc_account_get_param_int (settings->account, "port", &port);
mc_account_get_param_string (settings->account, "account", &id);
mc_account_get_param_string (settings->account, "password", &password);
mc_account_get_param_boolean (settings->account, "old-ssl", &old_ssl);
+ if (!id) {
+ McProfile *profile;
+ const gchar *server;
+
+ profile = mc_account_get_profile (settings->account);
+ server = mc_profile_get_default_account_domain (profile);
+ if (server) {
+ id = g_strconcat ("user@", server, NULL);
+ }
+ g_object_unref (profile);
+ }
+
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (settings->checkbutton_ssl), old_ssl);
gtk_entry_set_text (GTK_ENTRY (settings->entry_id), id ? id : "");
gtk_entry_set_text (GTK_ENTRY (settings->entry_password), password ? password : "");
g_object_unref (size_group);
+ gtk_widget_show (settings->vbox_settings);
+
return settings->vbox_settings;
}