diff options
Diffstat (limited to 'irc.c')
| -rw-r--r-- | irc.c | 23 | 
1 files changed, 18 insertions, 5 deletions
| @@ -28,6 +28,7 @@  #include "sock.h"  #include "crypting.h"  #include "ipc.h" +#include "dcc.h"  static gboolean irc_userping( gpointer _irc, int fd, b_input_condition cond ); @@ -124,7 +125,7 @@ irc_t *irc_new( int fd )  	irc->fd = fd;  	sock_make_nonblocking( irc->fd ); -	irc->r_watch_source_id = b_input_add( irc->fd, GAIM_INPUT_READ, bitlbee_io_current_client_read, irc ); +	irc->r_watch_source_id = b_input_add( irc->fd, B_EV_IO_READ, bitlbee_io_current_client_read, irc );  	irc->status = USTATUS_OFFLINE;  	irc->last_pong = gettime(); @@ -214,6 +215,8 @@ irc_t *irc_new( int fd )  	/* Evaluator sets the iconv/oconv structures. */  	set_eval_charset( set_find( &irc->set, "charset" ), set_getstr( &irc->set, "charset" ) ); +	nogaim_init(); +	  	return( irc );  } @@ -695,10 +698,10 @@ void irc_vawrite( irc_t *irc, char *format, va_list params )  		   the queue. If it's FALSE, we emptied the buffer and saved ourselves some work  		   in the event queue. */  		/* Really can't be done as long as the code doesn't do error checking very well: -		if( bitlbee_io_current_client_write( irc, irc->fd, GAIM_INPUT_WRITE ) ) */ +		if( bitlbee_io_current_client_write( irc, irc->fd, B_EV_IO_WRITE ) ) */  		/* So just always do it via the event handler. */ -		irc->w_watch_source_id = b_input_add( irc->fd, GAIM_INPUT_WRITE, bitlbee_io_current_client_write, irc ); +		irc->w_watch_source_id = b_input_add( irc->fd, B_EV_IO_WRITE, bitlbee_io_current_client_write, irc );  	}  	return; @@ -724,7 +727,7 @@ void irc_write_all( int now, char *format, ... )  		irc_vawrite( temp->data, format, params );  		if( now )  		{ -			bitlbee_io_current_client_write( irc, irc->fd, GAIM_INPUT_WRITE ); +			bitlbee_io_current_client_write( irc, irc->fd, B_EV_IO_WRITE );  		}  		temp = temp->next;  	} @@ -1125,9 +1128,19 @@ int irc_send( irc_t *irc, char *nick, char *s, int flags )  			}  			return( 1 );  		} +		else if( g_strncasecmp( s + 1, "DCC", 3 ) == 0 ) +		{ +			if( u && u->ic && u->ic->acc->prpl->transfer_request ) +			{ +				file_transfer_t *ft = dcc_request( u->ic, s + 5 ); +				if ( ft ) +					u->ic->acc->prpl->transfer_request( u->ic, ft, u->handle ); +			} +			return( 1 ); +		}		  		else  		{ -			irc_usermsg( irc, "Non-ACTION CTCP's aren't supported" ); +			irc_usermsg( irc, "Supported CTCPs are ACTION, VERSION, PING, TYPING, DCC" );  			return( 0 );  		}  	} | 
