diff options
Diffstat (limited to 'protocols/msn')
| -rw-r--r-- | protocols/msn/msn.h | 4 | ||||
| -rw-r--r-- | protocols/msn/ns.c | 20 | ||||
| -rw-r--r-- | protocols/msn/sb.c | 20 | 
3 files changed, 28 insertions, 16 deletions
diff --git a/protocols/msn/msn.h b/protocols/msn/msn.h index 0cd174f2..dbbb6aa0 100644 --- a/protocols/msn/msn.h +++ b/protocols/msn/msn.h @@ -145,7 +145,7 @@ GSList *msn_connections;  GSList *msn_switchboards;  /* ns.c */ -void msn_ns_connected( gpointer data, gint source, GaimInputCondition cond ); +gboolean msn_ns_connected( gpointer data, gint source, b_input_condition cond );  /* msn_util.c */  int msn_write( struct gaim_connection *gc, char *s, int len ); @@ -172,4 +172,4 @@ struct msn_switchboard *msn_sb_spare( struct gaim_connection *gc );  int msn_sb_sendmessage( struct msn_switchboard *sb, char *text );  void msn_sb_to_chat( struct msn_switchboard *sb );  void msn_sb_destroy( struct msn_switchboard *sb ); -void msn_sb_connected( gpointer data, gint source, GaimInputCondition cond ); +gboolean msn_sb_connected( gpointer data, gint source, b_input_condition cond ); diff --git a/protocols/msn/ns.c b/protocols/msn/ns.c index 90d525ef..af3793f2 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 ); diff --git a/protocols/msn/sb.c b/protocols/msn/sb.c index 234be1d6..54e89043 100644 --- a/protocols/msn/sb.c +++ b/protocols/msn/sb.c @@ -29,7 +29,7 @@  #include "passport.h"  #include "md5.h" -static void msn_sb_callback( gpointer data, gint source, GaimInputCondition cond ); +static gboolean msn_sb_callback( gpointer data, gint source, b_input_condition cond );  static int msn_sb_command( gpointer data, char **cmd, int num_parts );  static int msn_sb_message( gpointer data, char *msg, int msglen, char **cmd, int num_parts ); @@ -236,7 +236,7 @@ void msn_sb_destroy( struct msn_switchboard *sb )  		g_free( sb->handler );  	} -	if( sb->inp ) gaim_input_remove( sb->inp ); +	if( sb->inp ) b_event_remove( sb->inp );  	closesocket( sb->fd );  	msn_switchboards = g_slist_remove( msn_switchboards, sb ); @@ -244,7 +244,7 @@ void msn_sb_destroy( struct msn_switchboard *sb )  	g_free( sb );  } -void msn_sb_connected( gpointer data, gint source, GaimInputCondition cond ) +gboolean msn_sb_connected( gpointer data, gint source, b_input_condition cond )  {  	struct msn_switchboard *sb = data;  	struct gaim_connection *gc; @@ -253,7 +253,7 @@ void msn_sb_connected( gpointer data, gint source, GaimInputCondition cond )  	/* Are we still alive? */  	if( !g_slist_find( msn_switchboards, sb ) ) -		return; +		return FALSE;  	gc = sb->gc;  	md = gc->proto_data; @@ -262,7 +262,7 @@ void msn_sb_connected( gpointer data, gint source, GaimInputCondition cond )  	{  		debug( "ERROR %d while connecting to switchboard server", 1 );  		msn_sb_destroy( sb ); -		return; +		return FALSE;  	}  	/* Prepare the callback */ @@ -279,12 +279,14 @@ void msn_sb_connected( gpointer data, gint source, GaimInputCondition cond )  		g_snprintf( buf, sizeof( buf ), "ANS %d %s %s %d\r\n", ++sb->trId, gc->username, sb->key, sb->session );  	if( msn_sb_write( sb, buf, strlen( buf ) ) ) -		sb->inp = gaim_input_add( sb->fd, GAIM_INPUT_READ, msn_sb_callback, sb ); +		sb->inp = b_input_add( sb->fd, GAIM_INPUT_READ, msn_sb_callback, sb );  	else  		debug( "ERROR %d while connecting to switchboard server", 2 ); +	 +	return FALSE;  } -static void msn_sb_callback( gpointer data, gint source, GaimInputCondition cond ) +static gboolean msn_sb_callback( gpointer data, gint source, b_input_condition cond )  {  	struct msn_switchboard *sb = data; @@ -292,7 +294,11 @@ static void msn_sb_callback( gpointer data, gint source, GaimInputCondition cond  	{  		debug( "ERROR: Switchboard died" );  		msn_sb_destroy( sb ); +		 +		return FALSE;  	} +	else +		return TRUE;  }  static int msn_sb_command( gpointer data, char **cmd, int num_parts )  | 
