diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2006-06-21 18:34:33 +0200 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2006-06-21 18:34:33 +0200 | 
| commit | b72caac09b5944ee9954eb18262fe45228665570 (patch) | |
| tree | b44353f8ab3d23702f49e129d53b787952fe6546 /protocols/msn/ns.c | |
| parent | 3af70b06b2f0fb0fb41a041f6d86e3711b9eea3f (diff) | |
| parent | df417ca6657bc824e1dbd4a6026284656a42ce40 (diff) | |
Merging libevent branch: Events can now be handles by both glib and libevent.
Diffstat (limited to 'protocols/msn/ns.c')
| -rw-r--r-- | protocols/msn/ns.c | 20 | 
1 files changed, 13 insertions, 7 deletions
diff --git a/protocols/msn/ns.c b/protocols/msn/ns.c index 523de0ae..e4c2b68c 100644 --- a/protocols/msn/ns.c +++ b/protocols/msn/ns.c @@ -29,26 +29,26 @@  #include "passport.h"  #include "md5.h" -static void msn_ns_callback( gpointer data, gint source, GaimInputCondition cond ); +static gboolean msn_ns_callback( gpointer data, gint source, b_input_condition cond );  static int msn_ns_command( gpointer data, char **cmd, int num_parts );  static int msn_ns_message( gpointer data, char *msg, int msglen, char **cmd, int num_parts );  static void msn_auth_got_passport_id( struct passport_reply *rep ); -void msn_ns_connected( gpointer data, gint source, GaimInputCondition cond ) +gboolean msn_ns_connected( gpointer data, gint source, b_input_condition cond )  {  	struct gaim_connection *gc = data;  	struct msn_data *md;  	char s[1024];  	if( !g_slist_find( msn_connections, gc ) ) -		return; +		return FALSE;  	if( source == -1 )  	{  		hide_login_progress( gc, "Could not connect to server" );  		signoff( gc ); -		return; +		return FALSE;  	}  	md = gc->proto_data; @@ -74,12 +74,14 @@ void msn_ns_connected( gpointer data, gint source, GaimInputCondition cond )  	g_snprintf( s, sizeof( s ), "VER %d MSNP8 CVR0\r\n", ++md->trId );  	if( msn_write( gc, s, strlen( s ) ) )  	{ -		gc->inpa = gaim_input_add( md->fd, GAIM_INPUT_READ, msn_ns_callback, gc ); +		gc->inpa = b_input_add( md->fd, GAIM_INPUT_READ, msn_ns_callback, gc );  		set_login_progress( gc, 1, "Connected to server, waiting for reply" );  	} +	 +	return FALSE;  } -void msn_ns_callback( gpointer data, gint source, GaimInputCondition cond ) +static gboolean msn_ns_callback( gpointer data, gint source, b_input_condition cond )  {  	struct gaim_connection *gc = data;  	struct msn_data *md = gc->proto_data; @@ -88,7 +90,11 @@ void msn_ns_callback( gpointer data, gint source, GaimInputCondition cond )  	{  		hide_login_progress( gc, "Error while reading from server" );  		signoff( gc ); +		 +		return FALSE;  	} +	else +		return TRUE;  }  static int msn_ns_command( gpointer data, char **cmd, int num_parts ) @@ -129,7 +135,7 @@ static int msn_ns_command( gpointer data, char **cmd, int num_parts )  		if( num_parts == 6 && strcmp( cmd[2], "NS" ) == 0 )  		{ -			gaim_input_remove( gc->inpa ); +			b_event_remove( gc->inpa );  			gc->inpa = 0;  			closesocket( md->fd );  | 
