nicklist_find() now finds only full nicks, nicklist_find_mask() finds

nick masks. This fixes *a* and similiar emphasis where irssi tried to
find nick mask *a* instead of nick *a*.

Also, emphasis with highascii didn't work unless emphasis_multiword was
set ON.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1143 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-01-28 01:45:31 +00:00 committed by cras
commit 4cbabe2a83
5 changed files with 39 additions and 20 deletions

View file

@ -188,16 +188,15 @@ void channel_send_autocommands(CHANNEL_REC *channel)
for (bot = bots; *bot != NULL; bot++) {
const char *botnick = *bot;
nick = nicklist_find(channel,
channel->server->isnickflag(*botnick) ?
botnick+1 : botnick);
if (nick == NULL ||
!match_nick_flags(channel->server, nick, *botnick))
continue;
/* got one! */
eval_special_string(rec->autosendcmd, nick->nick, channel->server, channel);
break;
nick = nicklist_find_mask(channel,
channel->server->isnickflag(*botnick) ?
botnick+1 : botnick);
if (nick != NULL &&
match_nick_flags(channel->server, nick, *botnick)) {
eval_special_string(rec->autosendcmd, nick->nick,
channel->server, channel);
break;
}
}
g_strfreev(bots);
}

View file

@ -156,8 +156,17 @@ GSList *nicklist_find_multiple(CHANNEL_REC *channel, const char *mask)
return nicks;
}
/* Find nick record from list */
NICK_REC *nicklist_find(CHANNEL_REC *channel, const char *mask)
/* Find nick */
NICK_REC *nicklist_find(CHANNEL_REC *channel, const char *nick)
{
g_return_val_if_fail(IS_CHANNEL(channel), NULL);
g_return_val_if_fail(nick != NULL, NULL);
return g_hash_table_lookup(channel->nicks, nick);
}
/* Find nick mask, wildcards allowed */
NICK_REC *nicklist_find_mask(CHANNEL_REC *channel, const char *mask)
{
NICK_REC *nickrec;
char *nick, *host;

View file

@ -23,8 +23,10 @@ void nicklist_remove(CHANNEL_REC *channel, NICK_REC *nick);
void nicklist_rename(SERVER_REC *server, const char *old_nick,
const char *new_nick);
/* Find nick record from list */
NICK_REC *nicklist_find(CHANNEL_REC *channel, const char *mask);
/* Find nick */
NICK_REC *nicklist_find(CHANNEL_REC *channel, const char *nick);
/* Find nick mask, wildcards allowed */
NICK_REC *nicklist_find_mask(CHANNEL_REC *channel, const char *mask);
/* Get list of nicks that match the mask */
GSList *nicklist_find_multiple(CHANNEL_REC *channel, const char *mask);
/* Get list of nicks */