diff options
author | Timo Sirainen <cras@irssi.org> | 2001-02-02 22:10:20 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-02-02 22:10:20 +0000 |
commit | e3875169515c0b571c90b914f16327835eb47105 (patch) | |
tree | 7a0c2327e03ef16aba7851236d19abf04ce1ea2b /src/core | |
parent | 72407171983277df44c1cfe62e3f7abdff9cfa6d (diff) | |
download | irssi-e3875169515c0b571c90b914f16327835eb47105.zip |
Nicklist updates so that protocol specific xxx_NICK_REC can be used
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1177 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/nicklist.c | 27 | ||||
-rw-r--r-- | src/core/nicklist.h | 3 |
2 files changed, 7 insertions, 23 deletions
diff --git a/src/core/nicklist.c b/src/core/nicklist.c index 4014afc1..fab66154 100644 --- a/src/core/nicklist.c +++ b/src/core/nicklist.c @@ -31,30 +31,15 @@ (isalnum(a) || (unsigned char) (a) >= 128) /* Add new nick to list */ -NICK_REC *nicklist_insert(CHANNEL_REC *channel, const char *nick, - int op, int voice, int send_massjoin) +void nicklist_insert(CHANNEL_REC *channel, NICK_REC *nick) { - NICK_REC *rec; - - g_return_val_if_fail(IS_CHANNEL(channel), NULL); - g_return_val_if_fail(nick != NULL, NULL); + MODULE_DATA_INIT(nick); - rec = g_new0(NICK_REC, 1); + nick->type = module_get_uniq_id("NICK", 0); + nick->chat_type = channel->chat_type; - MODULE_DATA_INIT(rec); - rec->type = module_get_uniq_id("NICK", 0); - rec->chat_type = channel->chat_type; - - if (op) rec->op = TRUE; - if (voice) rec->voice = TRUE; - - rec->send_massjoin = send_massjoin; - rec->nick = g_strdup(nick); - rec->host = NULL; - - g_hash_table_insert(channel->nicks, rec->nick, rec); - signal_emit("nicklist new", 2, channel, rec); - return rec; + g_hash_table_insert(channel->nicks, nick->nick, nick); + signal_emit("nicklist new", 2, channel, nick); } /* Set host address for nick */ diff --git a/src/core/nicklist.h b/src/core/nicklist.h index 46604feb..2c47562d 100644 --- a/src/core/nicklist.h +++ b/src/core/nicklist.h @@ -13,8 +13,7 @@ struct _NICK_REC { }; /* Add new nick to list */ -NICK_REC *nicklist_insert(CHANNEL_REC *channel, const char *nick, - int op, int voice, int send_massjoin); +void nicklist_insert(CHANNEL_REC *channel, NICK_REC *nick); /* Set host address for nick */ void nicklist_set_host(CHANNEL_REC *channel, NICK_REC *nick, const char *host); /* Remove nick from list */ |