Mercurial > pidgin
changeset 27409:531454a6026d
merge of '3f1d2c03aab34120c7c659a581ffa8d156041d51'
and '6b26dbc439fec2159e7e9f20b2a3161288ca1c98'
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Tue, 07 Jul 2009 17:44:23 +0000 |
parents | 8a46d5528c3c (diff) 71e8748bc408 (current diff) |
children | d9ee3adfee58 |
files | |
diffstat | 2 files changed, 20 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/pidgin/gtkrequest.c Tue Jul 07 15:50:45 2009 +0000 +++ b/pidgin/gtkrequest.c Tue Jul 07 17:44:23 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 15:50:45 2009 +0000 +++ b/pidgin/plugins/disco/xmppdisco.c Tue Jul 07 17:44:23 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) {