diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-07-24 23:16:18 +0200 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-07-24 23:16:18 +0200 |
commit | 2945c6ff5d1848f6d8e51a0d804a2d769e6894a7 (patch) | |
tree | 595788105189dab5270fe2b7dc4e9baffa487aed /query.c | |
parent | ef14a83adbb9036c0006ad460c5e11882a3d7e13 (diff) | |
parent | 593971d9ff9f246cec5af5583f29e45fee62edfe (diff) |
Merge ui-fix (which includes killerbee (i.e. file transfers and libpurple
support)). ui-fix rewrites the complete IRC core, fixing many things that
were broken/hacky/limited so far.
The list is too long to include here, but http://wiki.bitlbee.org/UiFix
has a summary, as does doc/CHANGES and of course the full revision history.
Diffstat (limited to 'query.c')
-rw-r--r-- | query.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -30,7 +30,8 @@ static void query_display( irc_t *irc, query_t *q ); static query_t *query_default( irc_t *irc ); query_t *query_add( irc_t *irc, struct im_connection *ic, char *question, - query_callback yes, query_callback no, void *data ) + query_callback yes, query_callback no, query_callback free, + void *data ) { query_t *q = g_new0( query_t, 1 ); @@ -38,6 +39,7 @@ query_t *query_add( irc_t *irc, struct im_connection *ic, char *question, q->question = g_strdup( question ); q->yes = yes; q->no = no; + q->free = free; q->data = data; if( strchr( irc->umode, 'b' ) != NULL ) @@ -63,7 +65,7 @@ query_t *query_add( irc_t *irc, struct im_connection *ic, char *question, irc->queries = q; } - if( g_strcasecmp( set_getstr( &irc->set, "query_order" ), "lifo" ) == 0 || irc->queries == q ) + if( g_strcasecmp( set_getstr( &irc->b->set, "query_order" ), "lifo" ) == 0 || irc->queries == q ) query_display( irc, q ); return( q ); @@ -93,7 +95,8 @@ void query_del( irc_t *irc, query_t *q ) } g_free( q->question ); - if( q->data ) g_free( q->data ); /* Memory leak... */ + if( q->free && q->data ) + q->free( q->data ); g_free( q ); } @@ -178,7 +181,7 @@ static query_t *query_default( irc_t *irc ) { query_t *q; - if( g_strcasecmp( set_getstr( &irc->set, "query_order" ), "fifo" ) == 0 ) + if( g_strcasecmp( set_getstr( &irc->b->set, "query_order" ), "fifo" ) == 0 ) q = irc->queries; else for( q = irc->queries; q && q->next; q = q->next ); |