aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/msn/msn_util.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2006-07-27 16:55:53 +0200
committerWilmer van der Gaast <wilmer@gaast.net>2006-07-27 16:55:53 +0200
commit2811940d678bd9340055e08a0462c21e710d5714 (patch)
tree7f4aac4bd54ed34feda848c2a659e1ea079bebc3 /protocols/msn/msn_util.c
parent639809488bb4ab59a4a4f15ef2d4cd34037a68a4 (diff)
Copy-paste considered harmful + Fixed double handling of gc->permit/deny
which actually broke the block/allow commands.
Diffstat (limited to 'protocols/msn/msn_util.c')
-rw-r--r--protocols/msn/msn_util.c35
1 files changed, 0 insertions, 35 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 );
}
24' href='#n224'>224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359