Changeset da3b536


Ignore:
Timestamp:
2006-05-23T08:09:16Z (13 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
a9ca7dd
Parents:
226fce1
Message:

Added bim_ functions for block/allow list management to keep gc->permit/deny
up-to-date at run-time.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • protocols/nogaim.c

    r226fce1 rda3b536  
    10711071        return( NULL );
    10721072}
     1073
     1074void bim_add_allow( struct gaim_connection *gc, char *handle )
     1075{
     1076        if( g_slist_find_custom( gc->permit, handle, (GCompareFunc) gc->prpl->cmp_buddynames ) == NULL )
     1077        {
     1078                gc->permit = g_slist_prepend( gc->permit, g_strdup( handle ) );
     1079        }
     1080       
     1081        gc->prpl->add_permit( gc, handle );
     1082}
     1083
     1084void bim_rem_allow( struct gaim_connection *gc, char *handle )
     1085{
     1086        GSList *l;
     1087       
     1088        if( ( l = g_slist_find_custom( gc->permit, handle, (GCompareFunc) gc->prpl->cmp_buddynames ) ) )
     1089        {
     1090                g_free( l->data );
     1091                gc->permit = g_slist_delete_link( gc->permit, l );
     1092        }
     1093       
     1094        gc->prpl->rem_permit( gc, handle );
     1095}
     1096
     1097void bim_add_block( struct gaim_connection *gc, char *handle )
     1098{
     1099        if( g_slist_find_custom( gc->deny, handle, (GCompareFunc) gc->prpl->cmp_buddynames ) == NULL )
     1100        {
     1101                gc->deny = g_slist_prepend( gc->deny, g_strdup( handle ) );
     1102        }
     1103       
     1104        gc->prpl->add_deny( gc, handle );
     1105}
     1106
     1107void bim_rem_block( struct gaim_connection *gc, char *handle )
     1108{
     1109        GSList *l;
     1110       
     1111        if( ( l = g_slist_find_custom( gc->deny, handle, (GCompareFunc) gc->prpl->cmp_buddynames ) ) )
     1112        {
     1113                g_free( l->data );
     1114                gc->deny = g_slist_delete_link( gc->deny, l );
     1115        }
     1116       
     1117        gc->prpl->rem_deny( gc, handle );
     1118}
  • protocols/nogaim.h

    r226fce1 rda3b536  
    198198int bim_chat_msg( struct gaim_connection *gc, int id, char *msg );
    199199
     200void bim_add_allow( struct gaim_connection *gc, char *handle );
     201void bim_rem_allow( struct gaim_connection *gc, char *handle );
     202void bim_add_block( struct gaim_connection *gc, char *handle );
     203void bim_rem_block( struct gaim_connection *gc, char *handle );
     204
    200205void nogaim_init();
    201206char *set_eval_away_devoice( irc_t *irc, set_t *set, char *value );
  • root_commands.c

    r226fce1 rda3b536  
    558558        else
    559559        {
    560                 gc->prpl->rem_permit( gc, cmd[2] );
    561                 gc->prpl->add_deny( gc, cmd[2] );
    562                 irc_usermsg( irc, "Buddy `%s' moved from your permit- to your deny-list", cmd[2] );
     560                bim_rem_allow( gc, cmd[2] );
     561                bim_add_block( gc, cmd[2] );
     562                irc_usermsg( irc, "Buddy `%s' moved from your allow- to your block-list", cmd[2] );
    563563        }
    564564}
     
    617617        else
    618618        {
    619                 gc->prpl->rem_deny( gc, cmd[2] );
    620                 gc->prpl->add_permit( gc, cmd[2] );
    621                
    622                 irc_usermsg( irc, "Buddy `%s' moved from your deny- to your permit-list", cmd[2] );
     619                bim_rem_block( gc, cmd[2] );
     620                bim_add_allow( gc, cmd[2] );
     621               
     622                irc_usermsg( irc, "Buddy `%s' moved from your block- to your allow-list", cmd[2] );
    623623        }
    624624}
Note: See TracChangeset for help on using the changeset viewer.