# HG changeset patch # User Paul Aurich # Date 1246943393 0 # Node ID ebb0f7d27f5b073210fb29da99bfd0d37a1f83da # Parent 12edccab4944ce5439346f13c1adb20da63952d7 Make the use of xmpp_iq_cb_data->context explicit. diff -r 12edccab4944 -r ebb0f7d27f5b pidgin/plugins/disco/xmppdisco.c --- a/pidgin/plugins/disco/xmppdisco.c Tue Jul 07 04:32:58 2009 +0000 +++ b/pidgin/plugins/disco/xmppdisco.c Tue Jul 07 05:09:53 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) {