changeset 32702:381033b07bb1

Remove and replace the Default Domain UI hack.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Thu, 29 Dec 2011 01:43:31 +0000
parents 498ededa58cb
children d14a39e84ff1
files libpurple/protocols/jabber/libfacebook.c libpurple/protocols/jabber/libgtalk.c pidgin/gtkaccount.c
diffstat 3 files changed, 2 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/libfacebook.c	Wed Dec 28 09:01:34 2011 +0000
+++ b/libpurple/protocols/jabber/libfacebook.c	Thu Dec 29 01:43:31 2011 +0000
@@ -260,7 +260,7 @@
 	GList *encryption_values = NULL;
 
 	/* Translators: 'domain' is used here in the context of Internet domains, e.g. pidgin.im */
-	split = purple_account_user_split_new(_("Domain"), NULL, '@');
+	split = purple_account_user_split_new(_("Domain"), "chat.facebook.com", '@');
 	purple_account_user_split_set_reverse(split, FALSE);
 	prpl_info.user_splits = g_list_append(prpl_info.user_splits, split);
 
--- a/libpurple/protocols/jabber/libgtalk.c	Wed Dec 28 09:01:34 2011 +0000
+++ b/libpurple/protocols/jabber/libgtalk.c	Thu Dec 29 01:43:31 2011 +0000
@@ -260,7 +260,7 @@
 	GList *encryption_values = NULL;
 
 	/* Translators: 'domain' is used here in the context of Internet domains, e.g. pidgin.im */
-	split = purple_account_user_split_new(_("Domain"), NULL, '@');
+	split = purple_account_user_split_new(_("Domain"), "gmail.com", '@');
 	purple_account_user_split_set_reverse(split, FALSE);
 	prpl_info.user_splits = g_list_append(prpl_info.user_splits, split);
 
--- a/pidgin/gtkaccount.c	Wed Dec 28 09:01:34 2011 +0000
+++ b/pidgin/gtkaccount.c	Thu Dec 29 01:43:31 2011 +0000
@@ -166,37 +166,6 @@
 static void add_proxy_options(AccountPrefsDialog *dialog, GtkWidget *parent);
 static void add_voice_options(AccountPrefsDialog *dialog);
 
-static const char *
-google_talk_default_domain_hackery(GtkWidget *protocol_combo, const char *value_if_gtalk)
-{
-	GtkTreeModel *model;
-	GtkTreeIter iter;
-	const char *value = NULL;
-
-	model = gtk_combo_box_get_model(GTK_COMBO_BOX(protocol_combo));
-	if (model != NULL && gtk_combo_box_get_active_iter(GTK_COMBO_BOX(protocol_combo), &iter)) {
-		char *protocol = NULL;
-
-		/* protocol is not stored as G_TYPE_STRING in the model so no g_free necessary */
-		gtk_tree_model_get(model, &iter, 2, &protocol, -1);
-		if (protocol && !strcmp("prpl-jabber", protocol)) {
-			char *item_name = NULL;
-
-			gtk_tree_model_get(model, &iter, 1, &item_name, -1);
-			if (item_name) {
-				if (!strcmp(item_name, _("Google Talk")))
-					value = value_if_gtalk;
-				g_free(item_name);
-			}
-			/* If it's not GTalk, but still Jabber then the value is not NULL, it's empty */
-			if (NULL == value)
-				value = "";
-		}
-	}
-
-	return value;
-}
-
 static GtkWidget *
 add_pref_box(AccountPrefsDialog *dialog, GtkWidget *parent,
 			 const char *text, GtkWidget *widget)
@@ -591,10 +560,6 @@
 		if (value == NULL)
 			value = purple_account_user_split_get_default_value(split);
 
-		/* Google Talk default domain hackery! */
-		if (!strcmp(_("Domain"), purple_account_user_split_get_text(split)) && !value)
-			value = google_talk_default_domain_hackery(dialog->protocol_menu, "gmail.com");
-
 		if (value != NULL)
 			gtk_entry_set_text(GTK_ENTRY(entry), value);
 	}