Ignore:
Timestamp:
2014-07-24T03:51:07Z (10 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
269580c
Parents:
757515a
Message:

Gadugadu local contact storage (ticket #917)

Patch originally by Michał Siejak, adapted for 3.2.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/account.c

    r757515a r1783ab6  
    2727#include "bitlbee.h"
    2828#include "account.h"
     29
     30static const char* account_protocols_local[] = {
     31        "gg", NULL
     32};
    2933
    3034static char *set_eval_nick_source( set_t *set, char *value );
     
    347351void account_on( bee_t *bee, account_t *a )
    348352{
     353        GHashTableIter nicks;
     354        gpointer k, v;
     355
    349356        if( a->ic )
    350357        {
     
    360367        if( a->ic && !( a->ic->flags & ( OPT_SLOW_LOGIN | OPT_LOGGED_IN ) ) )
    361368                a->ic->keepalive = b_timeout_add( 120000, account_on_timeout, a->ic );
     369
     370        if( a->flags & ACC_FLAG_LOCAL )
     371        {
     372                g_hash_table_iter_init(&nicks, a->nicks);
     373                while( g_hash_table_iter_next( &nicks, &k, &v ) )
     374                {
     375                        a->prpl->add_buddy( a->ic, (char*) k, NULL );
     376                }
     377        }
    362378}
    363379
     
    465481        return a->auto_reconnect_delay;
    466482}
     483
     484int protocol_account_islocal( const char* protocol )
     485{
     486        const char** p = account_protocols_local;
     487        do {
     488                if( strcmp( *p, protocol ) == 0 )
     489                        return 1;
     490        } while( *( ++p ) );
     491        return 0;
     492}
Note: See TracChangeset for help on using the changeset viewer.