1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 05:46:38 +02:00

irc: fix ignore on a host without nick

This commit is contained in:
Sebastien Helleu
2013-12-05 19:47:51 +01:00
parent dfa3e13e3d
commit ea16b06348
2 changed files with 16 additions and 2 deletions
+1
View File
@@ -49,6 +49,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
* aspell: fix detection of nicks with non-alphanumeric chars
* guile: disable guile gmp allocator (fix crash on unload of relay plugin)
(bug #40628)
* irc: fix ignore on a host without nick
* irc: use color code 0x1F (`ctrl-_`) for underlined text in input line (same
code as messages) (bug #40756)
* irc: use color code 0x16 (`ctrl-V`) for reverse video in messages
+15 -2
View File
@@ -177,6 +177,7 @@ irc_ignore_check (struct t_irc_server *server, const char *channel,
{
struct t_irc_ignore *ptr_ignore;
int server_match, channel_match;
char *pos;
if (!server)
return 0;
@@ -223,8 +224,20 @@ irc_ignore_check (struct t_irc_server *server, const char *channel,
{
if (nick && (regexec (ptr_ignore->regex_mask, nick, 0, NULL, 0) == 0))
return 1;
if (host && (regexec (ptr_ignore->regex_mask, host, 0, NULL, 0) == 0))
return 1;
if (host)
{
if (regexec (ptr_ignore->regex_mask, host, 0, NULL, 0) == 0)
return 1;
if (!strchr (ptr_ignore->mask, '!'))
{
pos = strchr (host, '!');
if (pos && (regexec (ptr_ignore->regex_mask, pos + 1,
0, NULL, 0) == 0))
{
return 1;
}
}
}
}
}