diff options
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 */ |