Changeset 1783ab6 for protocols


Ignore:
Timestamp:
2014-07-24T03:51:07Z (5 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

Location:
protocols
Files:
2 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}
  • protocols/account.h

    r757515a r1783ab6  
    5959int account_reconnect_delay( account_t *a );
    6060
     61int protocol_account_islocal( const char* protocol );
     62
    6163typedef enum
    6264{
     
    7072        ACC_FLAG_STATUS_MESSAGE = 0x02, /* Supports status messages (without being away). */
    7173        ACC_FLAG_HANDLE_DOMAINS = 0x04, /* Contact handles need a domain portion. */
     74        ACC_FLAG_LOCAL = 0x08,          /* Contact list is local. */
    7275} account_flag_t;
    7376
Note: See TracChangeset for help on using the changeset viewer.