Changeset 05a8932


Ignore:
Timestamp:
2010-05-22T12:21:27Z (15 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
c3caa46
Parents:
dca8eff
Message:

Enable changing and viewing of block/allow lists.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/purple/purple.c

    rdca8eff r05a8932  
    359359}
    360360
     361static void purple_add_permit( struct im_connection *ic, char *who )
     362{
     363        PurpleAccount *pa = ic->proto_data;
     364       
     365        purple_privacy_permit_add( pa, who, FALSE );
     366}
     367
     368static void purple_add_deny( struct im_connection *ic, char *who )
     369{
     370        PurpleAccount *pa = ic->proto_data;
     371       
     372        purple_privacy_deny_add( pa, who, FALSE );
     373}
     374
     375static void purple_rem_permit( struct im_connection *ic, char *who )
     376{
     377        PurpleAccount *pa = ic->proto_data;
     378       
     379        purple_privacy_permit_remove( pa, who, FALSE );
     380}
     381
     382static void purple_rem_deny( struct im_connection *ic, char *who )
     383{
     384        PurpleAccount *pa = ic->proto_data;
     385       
     386        purple_privacy_deny_remove( pa, who, FALSE );
     387}
     388
    361389static void purple_get_info( struct im_connection *ic, char *who )
    362390{
     
    801829};
    802830
     831static void prplcb_privacy_permit_added( PurpleAccount *account, const char *name )
     832{
     833        struct im_connection *ic = purple_ic_by_pa( account );
     834       
     835        if( !g_slist_find_custom( ic->permit, name, (GCompareFunc) ic->acc->prpl->handle_cmp ) )
     836                ic->permit = g_slist_prepend( ic->permit, g_strdup( name ) );
     837}
     838
     839static void prplcb_privacy_permit_removed( PurpleAccount *account, const char *name )
     840{
     841        struct im_connection *ic = purple_ic_by_pa( account );
     842        void *n;
     843       
     844        n = g_slist_find_custom( ic->permit, name, (GCompareFunc) ic->acc->prpl->handle_cmp );
     845        ic->permit = g_slist_remove( ic->permit, n );
     846}
     847
     848static void prplcb_privacy_deny_added( PurpleAccount *account, const char *name )
     849{
     850        struct im_connection *ic = purple_ic_by_pa( account );
     851       
     852        if( !g_slist_find_custom( ic->deny, name, (GCompareFunc) ic->acc->prpl->handle_cmp ) )
     853                ic->deny = g_slist_prepend( ic->deny, g_strdup( name ) );
     854}
     855
     856static void prplcb_privacy_deny_removed( PurpleAccount *account, const char *name )
     857{
     858        struct im_connection *ic = purple_ic_by_pa( account );
     859        void *n;
     860       
     861        n = g_slist_find_custom( ic->deny, name, (GCompareFunc) ic->acc->prpl->handle_cmp );
     862        ic->deny = g_slist_remove( ic->deny, n );
     863}
     864
     865static PurplePrivacyUiOps bee_privacy_uiops =
     866{
     867        prplcb_privacy_permit_added,
     868        prplcb_privacy_permit_removed,
     869        prplcb_privacy_deny_added,
     870        prplcb_privacy_deny_removed,
     871};
     872
    803873static void prplcb_debug_print( PurpleDebugLevel level, const char *category, const char *arg_s )
    804874{
     
    917987        purple_notify_set_ui_ops( &bee_notify_uiops );
    918988        purple_xfers_set_ui_ops( &bee_xfer_uiops );
     989        purple_privacy_set_ui_ops( &bee_privacy_uiops );
    919990       
    920991        if( getenv( "BITLBEE_DEBUG" ) )
     
    9621033        funcs.add_buddy = purple_add_buddy;
    9631034        funcs.remove_buddy = purple_remove_buddy;
     1035        funcs.add_permit = purple_add_permit;
     1036        funcs.add_deny = purple_add_deny;
     1037        funcs.rem_permit = purple_rem_permit;
     1038        funcs.rem_deny = purple_rem_deny;
    9641039        funcs.get_info = purple_get_info;
    9651040        funcs.keepalive = purple_keepalive;
Note: See TracChangeset for help on using the changeset viewer.