forked from PsychoticNinja/irssi
Add prefixes to irc_nicklist_insert() so that nickrec.prefixes is accurate in the
"nicklist new" signal. Fixes the nicklist sorting on xirssi. Patch by nenolod. git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5184 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
ab33ac15af
commit
350b346c84
@ -31,7 +31,8 @@
|
|||||||
|
|
||||||
/* Add new nick to list */
|
/* Add new nick to list */
|
||||||
NICK_REC *irc_nicklist_insert(IRC_CHANNEL_REC *channel, const char *nick,
|
NICK_REC *irc_nicklist_insert(IRC_CHANNEL_REC *channel, const char *nick,
|
||||||
int op, int halfop, int voice, int send_massjoin)
|
int op, int halfop, int voice, int send_massjoin,
|
||||||
|
char *prefixes)
|
||||||
{
|
{
|
||||||
NICK_REC *rec;
|
NICK_REC *rec;
|
||||||
|
|
||||||
@ -46,6 +47,10 @@ NICK_REC *irc_nicklist_insert(IRC_CHANNEL_REC *channel, const char *nick,
|
|||||||
if (voice) rec->voice = TRUE;
|
if (voice) rec->voice = TRUE;
|
||||||
rec->send_massjoin = send_massjoin;
|
rec->send_massjoin = send_massjoin;
|
||||||
|
|
||||||
|
if (prefixes != NULL) {
|
||||||
|
strocpy(rec->prefixes, prefixes, sizeof(rec->prefixes));
|
||||||
|
}
|
||||||
|
|
||||||
nicklist_insert(CHANNEL(channel), rec);
|
nicklist_insert(CHANNEL(channel), rec);
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
@ -159,8 +164,7 @@ static void event_names_list(IRC_SERVER_REC *server, const char *data)
|
|||||||
|
|
||||||
if (nicklist_find((CHANNEL_REC *) chanrec, ptr) == NULL) {
|
if (nicklist_find((CHANNEL_REC *) chanrec, ptr) == NULL) {
|
||||||
rec = irc_nicklist_insert(chanrec, ptr, op, halfop,
|
rec = irc_nicklist_insert(chanrec, ptr, op, halfop,
|
||||||
voice, FALSE);
|
voice, FALSE, prefixes);
|
||||||
memcpy(rec->prefixes, prefixes, sizeof(rec->prefixes));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,7 +191,7 @@ static void event_end_of_names(IRC_SERVER_REC *server, const char *data)
|
|||||||
nicks = g_hash_table_size(chanrec->nicks);
|
nicks = g_hash_table_size(chanrec->nicks);
|
||||||
ownnick = irc_nicklist_insert(chanrec, server->nick,
|
ownnick = irc_nicklist_insert(chanrec, server->nick,
|
||||||
nicks == 0, FALSE,
|
nicks == 0, FALSE,
|
||||||
FALSE, FALSE);
|
FALSE, FALSE, NULL);
|
||||||
}
|
}
|
||||||
nicklist_set_own(CHANNEL(chanrec), ownnick);
|
nicklist_set_own(CHANNEL(chanrec), ownnick);
|
||||||
chanrec->chanop = chanrec->ownnick->op;
|
chanrec->chanop = chanrec->ownnick->op;
|
||||||
|
@ -5,7 +5,8 @@
|
|||||||
|
|
||||||
/* Add new nick to list */
|
/* Add new nick to list */
|
||||||
NICK_REC *irc_nicklist_insert(IRC_CHANNEL_REC *channel, const char *nick,
|
NICK_REC *irc_nicklist_insert(IRC_CHANNEL_REC *channel, const char *nick,
|
||||||
int op, int halfop, int voice, int send_massjoin);
|
int op, int halfop, int voice, int send_massjoin,
|
||||||
|
char *prefixes);
|
||||||
|
|
||||||
/* Remove all "extra" characters from `nick'. Like _nick_ -> nick */
|
/* Remove all "extra" characters from `nick'. Like _nick_ -> nick */
|
||||||
char *irc_nick_strip(const char *nick);
|
char *irc_nick_strip(const char *nick);
|
||||||
|
@ -129,7 +129,6 @@ static void sig_session_restore_nick(IRC_CHANNEL_REC *channel,
|
|||||||
op = config_node_get_bool(node, "op", FALSE);
|
op = config_node_get_bool(node, "op", FALSE);
|
||||||
voice = config_node_get_bool(node, "voice", FALSE);
|
voice = config_node_get_bool(node, "voice", FALSE);
|
||||||
halfop = config_node_get_bool(node, "halfop", FALSE);
|
halfop = config_node_get_bool(node, "halfop", FALSE);
|
||||||
nickrec = irc_nicklist_insert(channel, nick, op, halfop, voice, FALSE);
|
|
||||||
prefixes = config_node_get_str(node, "prefixes", NULL);
|
prefixes = config_node_get_str(node, "prefixes", NULL);
|
||||||
if (prefixes == NULL || *prefixes == '\0') {
|
if (prefixes == NULL || *prefixes == '\0') {
|
||||||
/* upgrading from old irssi or from an in-between
|
/* upgrading from old irssi or from an in-between
|
||||||
@ -146,9 +145,7 @@ static void sig_session_restore_nick(IRC_CHANNEL_REC *channel,
|
|||||||
newprefixes[i] = '\0';
|
newprefixes[i] = '\0';
|
||||||
prefixes = newprefixes;
|
prefixes = newprefixes;
|
||||||
}
|
}
|
||||||
strocpy(nickrec->prefixes,
|
nickrec = irc_nicklist_insert(channel, nick, op, halfop, voice, FALSE, prefixes);
|
||||||
prefixes,
|
|
||||||
sizeof(nickrec->prefixes));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void session_restore_channel(IRC_CHANNEL_REC *channel)
|
static void session_restore_channel(IRC_CHANNEL_REC *channel)
|
||||||
|
@ -65,7 +65,7 @@ static void event_join(IRC_SERVER_REC *server, const char *data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* add user to nicklist */
|
/* add user to nicklist */
|
||||||
nickrec = irc_nicklist_insert(chanrec, nick, FALSE, FALSE, FALSE, TRUE);
|
nickrec = irc_nicklist_insert(chanrec, nick, FALSE, FALSE, FALSE, TRUE, NULL);
|
||||||
nicklist_set_host(CHANNEL(chanrec), nickrec, address);
|
nicklist_set_host(CHANNEL(chanrec), nickrec, address);
|
||||||
|
|
||||||
if (chanrec->massjoins == 0) {
|
if (chanrec->massjoins == 0) {
|
||||||
|
@ -58,6 +58,6 @@ irc_nick_insert(channel, nick, op, halfop, voice, send_massjoin)
|
|||||||
int voice
|
int voice
|
||||||
int send_massjoin
|
int send_massjoin
|
||||||
CODE:
|
CODE:
|
||||||
RETVAL = irc_nicklist_insert(channel, nick, op, halfop, voice, send_massjoin);
|
RETVAL = irc_nicklist_insert(channel, nick, op, halfop, voice, send_massjoin, NULL);
|
||||||
OUTPUT:
|
OUTPUT:
|
||||||
RETVAL
|
RETVAL
|
||||||
|
Loading…
x
Reference in New Issue
Block a user