diff options
Diffstat (limited to 'protocols')
| -rw-r--r-- | protocols/account.c | 26 | ||||
| -rw-r--r-- | protocols/account.h | 3 | 
2 files changed, 29 insertions, 0 deletions
| diff --git a/protocols/account.c b/protocols/account.c index b90a60ee..83c214b1 100644 --- a/protocols/account.c +++ b/protocols/account.c @@ -27,6 +27,10 @@  #include "bitlbee.h"  #include "account.h" +static const char* account_protocols_local[] = { +	"gg", NULL +}; +  static char *set_eval_nick_source( set_t *set, char *value );  account_t *account_add( bee_t *bee, struct prpl *prpl, char *user, char *pass ) @@ -346,6 +350,9 @@ static gboolean account_on_timeout( gpointer d, gint fd, b_input_condition cond  void account_on( bee_t *bee, account_t *a )  { +	GHashTableIter nicks; +	gpointer k, v; +  	if( a->ic )  	{  		/* Trying to enable an already-enabled account */ @@ -359,6 +366,15 @@ void account_on( bee_t *bee, account_t *a )  	if( a->ic && !( a->ic->flags & ( OPT_SLOW_LOGIN | OPT_LOGGED_IN ) ) )  		a->ic->keepalive = b_timeout_add( 120000, account_on_timeout, a->ic ); + +	if( a->flags & ACC_FLAG_LOCAL ) +	{ +		g_hash_table_iter_init(&nicks, a->nicks); +		while( g_hash_table_iter_next( &nicks, &k, &v ) ) +		{ +			a->prpl->add_buddy( a->ic, (char*) k, NULL ); +		} +	}  }  void account_off( bee_t *bee, account_t *a ) @@ -464,3 +480,13 @@ int account_reconnect_delay( account_t *a )  	return a->auto_reconnect_delay;  } + +int protocol_account_islocal( const char* protocol ) +{ +	const char** p = account_protocols_local; +	do { +		if( strcmp( *p, protocol ) == 0 ) +			return 1; +	} while( *( ++p ) ); +	return 0; +} diff --git a/protocols/account.h b/protocols/account.h index ed3ca531..14633fad 100644 --- a/protocols/account.h +++ b/protocols/account.h @@ -58,6 +58,8 @@ char *set_eval_account( set_t *set, char *value );  char *set_eval_account_reconnect_delay( set_t *set, char *value );  int account_reconnect_delay( account_t *a ); +int protocol_account_islocal( const char* protocol ); +  typedef enum  {  	ACC_SET_OFFLINE_ONLY = 0x02,    /* Allow changes only if the acct is offline. */ @@ -69,6 +71,7 @@ typedef enum  	ACC_FLAG_AWAY_MESSAGE = 0x01,   /* Supports away messages instead of just states. */  	ACC_FLAG_STATUS_MESSAGE = 0x02, /* Supports status messages (without being away). */  	ACC_FLAG_HANDLE_DOMAINS = 0x04, /* Contact handles need a domain portion. */ +	ACC_FLAG_LOCAL = 0x08,          /* Contact list is local. */  } account_flag_t;  #endif | 
