|
|
|
@ -236,8 +236,6 @@ static bool index_uri_to_account_id( const char* uri, int account_id )
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ffdb_trie_set( "data/accounts/by-uri", uri, id_str );
|
|
|
|
|
hash_index_remove( "data/accounts/uri_index/", uri );
|
|
|
|
|
//return hash_index_set( "data/accounts/uri_index/", uri, account_id );
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -282,21 +280,7 @@ int account_id_from_uri( const char* uri )
|
|
|
|
|
return id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int result = 0;
|
|
|
|
|
if( !hash_index_get( "data/accounts/uri_index/", uri, &result ) ) {
|
|
|
|
|
//return account_search_for_id_from_uri( uri );
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Migrate to trie
|
|
|
|
|
{
|
|
|
|
|
char id_str[32];
|
|
|
|
|
snprintf( id_str,32, "%d", result );
|
|
|
|
|
ffdb_trie_set( "data/accounts/by-uri", uri, id_str );
|
|
|
|
|
hash_index_remove( "data/accounts/uri_index/", uri );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
static int lookup_account_id_from_uri( const char* uri )
|
|
|
|
|
{
|
|
|
|
@ -520,11 +504,9 @@ void account_save( struct account* a )
|
|
|
|
|
char id_str[32];
|
|
|
|
|
snprintf( id_str,32, "%d", a->id );
|
|
|
|
|
ffdb_trie_set( "data/accounts/by-uri", a->account_url, id_str );
|
|
|
|
|
hash_index_remove( "data/accounts/uri_index/", a->account_url );
|
|
|
|
|
|
|
|
|
|
if( a->account_id ) {
|
|
|
|
|
ffdb_trie_set( "data/accounts/by-uri", a->account_id, id_str );
|
|
|
|
|
hash_index_remove( "data/accounts/uri_index/", a->account_id );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|