Changeset 1783ab6
- Timestamp:
- 2014-07-24T03:51:07Z (10 years ago)
- Branches:
- master
- Children:
- 269580c
- Parents:
- 757515a
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/account.c
r757515a r1783ab6 27 27 #include "bitlbee.h" 28 28 #include "account.h" 29 30 static const char* account_protocols_local[] = { 31 "gg", NULL 32 }; 29 33 30 34 static char *set_eval_nick_source( set_t *set, char *value ); … … 347 351 void account_on( bee_t *bee, account_t *a ) 348 352 { 353 GHashTableIter nicks; 354 gpointer k, v; 355 349 356 if( a->ic ) 350 357 { … … 360 367 if( a->ic && !( a->ic->flags & ( OPT_SLOW_LOGIN | OPT_LOGGED_IN ) ) ) 361 368 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 } 362 378 } 363 379 … … 465 481 return a->auto_reconnect_delay; 466 482 } 483 484 int 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 59 59 int account_reconnect_delay( account_t *a ); 60 60 61 int protocol_account_islocal( const char* protocol ); 62 61 63 typedef enum 62 64 { … … 70 72 ACC_FLAG_STATUS_MESSAGE = 0x02, /* Supports status messages (without being away). */ 71 73 ACC_FLAG_HANDLE_DOMAINS = 0x04, /* Contact handles need a domain portion. */ 74 ACC_FLAG_LOCAL = 0x08, /* Contact list is local. */ 72 75 } account_flag_t; 73 76 -
storage_xml.c
r757515a r1783ab6 87 87 char *pass_b64 = NULL; 88 88 unsigned char *pass_cr = NULL; 89 int pass_len ;89 int pass_len, local = 0; 90 90 struct prpl *prpl = NULL; 91 91 account_t *acc; … … 100 100 protocol = xt_find_attr( node, "protocol" ); 101 101 if( protocol ) 102 { 102 103 prpl = find_protocol( protocol ); 104 local = protocol_account_islocal( protocol ); 105 } 103 106 104 107 if( !handle || !pass_b64 || !protocol || !prpl ) … … 114 117 if( tag ) 115 118 set_setstr( &acc->set, "tag", tag ); 119 if( local ) 120 acc->flags |= ACC_FLAG_LOCAL; 116 121 } 117 122 else
Note: See TracChangeset
for help on using the changeset viewer.