diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2006-07-03 23:22:45 +0200 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2006-07-03 23:22:45 +0200 |
commit | 5b52a4895e5a59ff6509f7771f4d8665737688c3 (patch) | |
tree | 32c13033b127804864507d8ff90c0c274f8b07e5 /account.c | |
parent | 911f2eb7060f6af6fe8e4e02144cfb7c4bb4cc8b (diff) |
Implemented per-account nick lists instead of per-protocol nick lists.
nick_t is dead, instead nicks are just saves in a per-account_t GLib
hash table. While doing this, the import_buddies command finally died
and text_save() disappeared, because the old file format can't handle
most of the new features in this branch anyway.
Still have to implement support for the new nick lists in text_load()!
Diffstat (limited to 'account.c')
-rw-r--r-- | account.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -58,6 +58,8 @@ account_t *account_add( irc_t *irc, struct prpl *prpl, char *user, char *pass ) s->flags |= ACC_SET_NOSAVE | ACC_SET_OFFLINE_ONLY; set_setstr( &a->set, "username", user ); + a->nicks = g_hash_table_new_full( g_str_hash, g_str_equal, g_free, g_free ); + /* This function adds some more settings (and might want to do more things that have to be done now, although I can't think of anything. */ if( prpl->acc_init ) @@ -125,7 +127,7 @@ account_t *account_get( irc_t *irc, char *id ) { for( a = irc->accounts; a; a = a->next ) if( a->prpl == proto && - a->prpl->cmp_buddynames( handle, a->user ) == 0 ) + a->prpl->handle_cmp( handle, a->user ) == 0 ) ret = a; } @@ -189,6 +191,8 @@ void account_del( irc_t *irc, account_t *acc ) while( a->set ) set_del( &a->set, a->set->key ); + g_hash_table_destroy( a->nicks ); + g_free( a->user ); g_free( a->pass ); if( a->server ) g_free( a->server ); |