diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2006-07-27 16:55:53 +0200 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2006-07-27 16:55:53 +0200 | 
| commit | 2811940d678bd9340055e08a0462c21e710d5714 (patch) | |
| tree | 7f4aac4bd54ed34feda848c2a659e1ea079bebc3 | |
| parent | 639809488bb4ab59a4a4f15ef2d4cd34037a68a4 (diff) | |
Copy-paste considered harmful + Fixed double handling of gc->permit/deny
which actually broke the block/allow commands.
| -rw-r--r-- | protocols/msn/msn_util.c | 35 | ||||
| -rw-r--r-- | root_commands.c | 2 | 
2 files changed, 1 insertions, 36 deletions
| diff --git a/protocols/msn/msn_util.c b/protocols/msn/msn_util.c index c3bd73cc..4e748099 100644 --- a/protocols/msn/msn_util.c +++ b/protocols/msn/msn_util.c @@ -53,19 +53,8 @@ int msn_logged_in( struct gaim_connection *gc )  int msn_buddy_list_add( struct gaim_connection *gc, char *list, char *who, char *realname_ )  {  	struct msn_data *md = gc->proto_data; -	GSList *l, **lp = NULL;  	char buf[1024], *realname; -	if( strcmp( list, "AL" ) == 0 ) -		lp = &gc->permit; -	else if( strcmp( list, "BL" ) == 0 ) -		lp = &gc->deny; -	 -	if( lp ) -		for( l = *lp; l; l = l->next ) -			if( g_strcasecmp( l->data, who ) == 0 ) -				return( 1 ); -	  	realname = g_new0( char, strlen( realname_ ) * 3 + 1 );  	strcpy( realname, realname_ );  	http_encode( realname ); @@ -75,9 +64,6 @@ int msn_buddy_list_add( struct gaim_connection *gc, char *list, char *who, char  	{  		g_free( realname ); -		if( lp ) -			*lp = g_slist_append( *lp, g_strdup( who ) ); -		  		return( 1 );  	} @@ -89,32 +75,11 @@ int msn_buddy_list_add( struct gaim_connection *gc, char *list, char *who, char  int msn_buddy_list_remove( struct gaim_connection *gc, char *list, char *who )  {  	struct msn_data *md = gc->proto_data; -	GSList *l = NULL, **lp = NULL;  	char buf[1024]; -	if( strcmp( list, "AL" ) == 0 ) -		lp = &gc->permit; -	else if( strcmp( list, "BL" ) == 0 ) -		lp = &gc->deny; -	 -	if( lp ) -	{ -		for( l = *lp; l; l = l->next ) -			if( g_strcasecmp( l->data, who ) == 0 ) -				break; -		 -		if( !l ) -			return( 1 ); -	} -	  	g_snprintf( buf, sizeof( buf ), "REM %d %s %s\r\n", ++md->trId, list, who );  	if( msn_write( gc, buf, strlen( buf ) ) ) -	{ -		if( lp ) -			*lp = g_slist_remove( *lp, l->data ); -		  		return( 1 ); -	}  	return( 0 );  } diff --git a/root_commands.c b/root_commands.c index 3d3584b3..040d885c 100644 --- a/root_commands.c +++ b/root_commands.c @@ -579,7 +579,7 @@ static void cmd_allow( irc_t *irc, char **cmd )  			format = "%-32.32s  %-16.16s";  		irc_usermsg( irc, format, "Handle", "Nickname" ); -		for( l = a->gc->deny; l; l = l->next ) +		for( l = a->gc->permit; l; l = l->next )  		{  			user_t *u = user_findhandle( a->gc, l->data );  			irc_usermsg( irc, format, l->data, u ? u->nick : "(none)" ); | 
