Changeset b3117f2 for protocols/purple


Ignore:
Timestamp:
2009-11-23T22:58:20Z (10 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
4e04194
Parents:
6967d01
Message:

Adding/removing contacts now works.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/purple/purple.c

    r6967d01 rb3117f2  
    2222\***************************************************************************/
    2323
     24#include "bitlbee.h"
     25
    2426#include <glib.h>
    2527#include <purple.h>
    26 
    27 #include "bitlbee.h"
    2828
    2929GSList *purple_connections;
     
    8282                default:
    8383                        fprintf( stderr, "Setting with unknown type: %s (%d)\n", name, purple_account_option_get_type( o ) );
     84                        name = NULL;
    8485                }
    8586               
    86                 if( def != NULL )
     87                if( name != NULL )
    8788                {
    8889                        s = set_add( &acc->set, name, def, eval, acc );
     
    211212static void purple_add_buddy( struct im_connection *ic, char *who, char *group )
    212213{
     214        PurpleBuddy *pb;
     215       
     216        pb = purple_buddy_new( (PurpleAccount*) ic->proto_data, who, NULL );
     217        purple_blist_add_buddy( pb, NULL, NULL, NULL );
     218        purple_account_add_buddy( (PurpleAccount*) ic->proto_data, pb );
    213219}
    214220
    215221static void purple_remove_buddy( struct im_connection *ic, char *who, char *group )
    216222{
     223        PurpleBuddy *pb;
     224       
     225        pb = purple_find_buddy( (PurpleAccount*) ic->proto_data, who );
     226        if( pb != NULL )
     227        {
     228                purple_account_remove_buddy( (PurpleAccount*) ic->proto_data, pb, NULL );
     229                purple_blist_remove_buddy( pb );
     230        }
    217231}
    218232
     
    343357        PurpleBuddy *bud = (PurpleBuddy*) node;
    344358       
     359        /*
    345360        if( node->type == PURPLE_BLIST_BUDDY_NODE )
    346361        {
     
    352367                imcb_remove_buddy( ic, bud->name, NULL );
    353368        }
     369        */
    354370}
    355371
Note: See TracChangeset for help on using the changeset viewer.