]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/gossip-account-widget-jabber.c
New objects: GossipAccountChooser and GossipNewChatroom, we can now join
[empathy.git] / libempathy-gtk / gossip-account-widget-jabber.c
index 8282777bda49144db9deb42798a1aad22a43514d..e7334b4b564f6d670d95622f5cf06046ebe8b813 100644 (file)
@@ -30,6 +30,8 @@
 #include <gtk/gtk.h>
 #include <glade/glade.h>
 
+#include <libmissioncontrol/mc-profile.h>
+
 #include <libempathy/gossip-utils.h>
 
 #include "gossip-account-widget-jabber.h"
@@ -187,6 +189,18 @@ account_widget_jabber_setup (GossipAccountWidgetJabber *settings)
        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 : "");