diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2007-07-29 05:12:28 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2007-07-29 05:12:28 +0800 |
commit | 7817f0b39d43f6b2b2bf307c2e20c2be57c2c792 (patch) | |
tree | 12f4b1455507205ba607354280da6f6e346f5b19 | |
parent | 414a56dcd8e58d0dfe7a45a5c288b542daab5c61 (diff) | |
download | gsoc2013-empathy-7817f0b39d43f6b2b2bf307c2e20c2be57c2c792.tar gsoc2013-empathy-7817f0b39d43f6b2b2bf307c2e20c2be57c2c792.tar.gz gsoc2013-empathy-7817f0b39d43f6b2b2bf307c2e20c2be57c2c792.tar.bz2 gsoc2013-empathy-7817f0b39d43f6b2b2bf307c2e20c2be57c2c792.tar.lz gsoc2013-empathy-7817f0b39d43f6b2b2bf307c2e20c2be57c2c792.tar.xz gsoc2013-empathy-7817f0b39d43f6b2b2bf307c2e20c2be57c2c792.tar.zst gsoc2013-empathy-7817f0b39d43f6b2b2bf307c2e20c2be57c2c792.zip |
Try to guess the server from the jid only if we are using the jabber
2007-07-28 Xavier Claessens <xclaesse@gmail.com>
* libempathy-gtk/empathy-account-widget-jabber.c: Try to guess the
server from the jid only if we are using the jabber profile. When we
guessed a server don't forget to set the "server" McAccount param,
setting the entry's text is not enough.
svn path=/trunk/; revision=209
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | libempathy-gtk/empathy-account-widget-jabber.c | 27 |
2 files changed, 26 insertions, 8 deletions
@@ -1,5 +1,12 @@ 2007-07-28 Xavier Claessens <xclaesse@gmail.com> + * libempathy-gtk/empathy-account-widget-jabber.c: Try to guess the + server from the jid only if we are using the jabber profile. When we + guessed a server don't forget to set the "server" McAccount param, + setting the entry's text is not enough. + +2007-07-28 Xavier Claessens <xclaesse@gmail.com> + * libempathy-gtk/empathy-profile-chooser.c: Improve the sort function a bit to have Jabber before GTalk. diff --git a/libempathy-gtk/empathy-account-widget-jabber.c b/libempathy-gtk/empathy-account-widget-jabber.c index a4db08fdf..947da4a0e 100644 --- a/libempathy-gtk/empathy-account-widget-jabber.c +++ b/libempathy-gtk/empathy-account-widget-jabber.c @@ -102,15 +102,26 @@ account_widget_jabber_entry_focus_cb (GtkWidget *widget, mc_account_set_param_string (settings->account, param, str); if (widget == settings->entry_id) { - /* Try to guess the server */ - gchar *server; - - server = strstr (str, "@"); - if (server != NULL) { - /* skip the leading @ */ - server++; - gtk_entry_set_text (GTK_ENTRY (settings->entry_server), server); + McProfile *profile; + const gchar *profile_name; + + /* Try to guess the server if we are using the vanilla + * jabber profile. We don't have to do that with + * gtalk profile. */ + profile = mc_account_get_profile (settings->account); + profile_name = mc_profile_get_unique_name (profile); + if (strcmp (profile_name, "jabber") == 0) { + gchar *server; + + server = strstr (str, "@"); + if (server != NULL) { + /* skip the leading @ */ + server++; + gtk_entry_set_text (GTK_ENTRY (settings->entry_server), server); + mc_account_set_param_string (settings->account, "server", server); + } } + g_object_unref (profile); } } |