summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorailin-nemui <ailin-nemui@users.noreply.github.com>2015-09-23 00:07:03 +0200
committerailin-nemui <ailin-nemui@users.noreply.github.com>2015-09-23 00:07:03 +0200
commit618a636f7ca2a7b915bedc1cba2860e2b948a2a2 (patch)
tree850cc2785893c7960b9aa17f64f357aa75312a8e /src/core
parentf32620673ed26e9e4e730b021b46dc1a4e6cb720 (diff)
parent3f2eaf1d3a67eddd42dd88eccb39402d45297fcb (diff)
downloadirssi-618a636f7ca2a7b915bedc1cba2860e2b948a2a2.zip
Merge pull request #297 from vague666/hilight_nick_matches
Add new setting to modify behaviour of hilight_nick_matches to match anywhere in message Fixes #56
Diffstat (limited to 'src/core')
-rw-r--r--src/core/nicklist.c8
-rw-r--r--src/core/nicklist.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/core/nicklist.c b/src/core/nicklist.c
index a96b8a9e..770b0afc 100644
--- a/src/core/nicklist.c
+++ b/src/core/nicklist.c
@@ -571,6 +571,14 @@ int nick_match_msg(CHANNEL_REC *channel, const char *msg, const char *nick)
}
}
+int nick_match_msg_everywhere(CHANNEL_REC *channel, const char *msg, const char *nick)
+{
+ g_return_val_if_fail(nick != NULL, FALSE);
+ g_return_val_if_fail(msg != NULL, FALSE);
+
+ return stristr_full(msg, nick) != NULL;
+}
+
void nicklist_init(void)
{
signal_add_first("channel created", (SIGNAL_FUNC) sig_channel_created);
diff --git a/src/core/nicklist.h b/src/core/nicklist.h
index 55dfd5ef..5e0f4f75 100644
--- a/src/core/nicklist.h
+++ b/src/core/nicklist.h
@@ -55,6 +55,7 @@ int nicklist_compare(NICK_REC *p1, NICK_REC *p2, const char *nick_prefix);
/* Check is `msg' is meant for `nick'. */
int nick_match_msg(CHANNEL_REC *channel, const char *msg, const char *nick);
+int nick_match_msg_everywhere(CHANNEL_REC *channel, const char *msg, const char *nick);
void nicklist_init(void);
void nicklist_deinit(void);