changeset 27417:d9ee3adfee58

merge of 'd4111c3c390e4fbea55bfa213f353d6012f249d5' and 'e6faf7cfc687458f9e3d8f8a88c339de80843fc5'
author Gary Kramlich <grim@reaperworld.com>
date Wed, 08 Jul 2009 00:50:29 +0000
parents 531454a6026d (diff) b2106bf5a6b4 (current diff)
children e420ce168630 6b11903c87c8
files
diffstat 2 files changed, 20 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkrequest.c	Tue Jul 07 19:35:38 2009 +0000
+++ b/pidgin/gtkrequest.c	Wed Jul 08 00:50:29 2009 +0000
@@ -717,12 +717,16 @@
 			GtkWidget *optmenu = NULL;
 			PurpleRequestFieldGroup *group = purple_request_field_get_group(field);
 			GList *fields = group->fields;
+
+			/* Ensure the account option menu is created (if the widget hasn't
+			 * been initialized already) for username auto-completion. */
 			while (fields)
 			{
 				PurpleRequestField *fld = fields->data;
 				fields = fields->next;
 
-				if (purple_request_field_get_type(fld) == PURPLE_REQUEST_FIELD_ACCOUNT)
+				if (purple_request_field_get_type(fld) == PURPLE_REQUEST_FIELD_ACCOUNT &&
+						purple_request_field_is_visible(fld))
 				{
 					const char *type_hint = purple_request_field_get_type_hint(fld);
 					if (type_hint != NULL && strcmp(type_hint, "account") == 0)
@@ -730,7 +734,7 @@
 						optmenu = GTK_WIDGET(purple_request_field_get_ui_data(fld));
 						if (optmenu == NULL) {
 							optmenu = GTK_WIDGET(create_account_field(fld));
-							purple_request_field_set_ui_data(field, optmenu);
+							purple_request_field_set_ui_data(fld, optmenu);
 						}
 						break;
 					}
--- a/pidgin/plugins/disco/xmppdisco.c	Tue Jul 07 19:35:38 2009 +0000
+++ b/pidgin/plugins/disco/xmppdisco.c	Wed Jul 08 00:50:29 2009 +0000
@@ -59,13 +59,6 @@
                                const char *id, const char *from, xmlnode *iq,
                                gpointer data);
 
-struct xmpp_iq_cb_data
-{
-	gpointer context;
-	PurpleConnection *pc;
-	XmppIqCallback cb;
-};
-
 struct item_data {
 	PidginDiscoList *list;
 	XmppDiscoService *parent;
@@ -73,6 +66,20 @@
 	char *node; /* disco#info replies don't always include the node */
 };
 
+struct xmpp_iq_cb_data
+{
+	/*
+	 * Every IQ callback in this plugin uses the same structure for the
+	 * callback data. It's a hack (it wouldn't scale), but it's used so that
+	 * it's easy to clean up all the callbacks when the account disconnects
+	 * (see remove_iq_callbacks_by_pc below).
+	 */
+	struct item_data *context;
+	PurpleConnection *pc;
+	XmppIqCallback cb;
+};
+
+
 static char*
 generate_next_id()
 {
@@ -93,11 +100,6 @@
 	struct xmpp_iq_cb_data *cb_data = value;
 
 	if (cb_data && cb_data->pc == user_data) {
-		/*
-		 * This is a hack. All the IQ callback datas in this code are
-		 * the same structure so that we can free them here. Ideally they'd
-		 * be objects and this would be polymorphic. That's overkill, here.
-		 */
 		struct item_data *item_data = cb_data->context;
 
 		if (item_data) {