From 74418527f59a3d0d0c9f9d9bfac14e5b8b369242 Mon Sep 17 00:00:00 2001 From: Jari Matilainen Date: Sun, 4 Oct 2015 17:40:33 +0200 Subject: [PATCH 1/3] Make /hilight list be specific with regards to -nick/-word/-line --- src/fe-common/core/hilight-text.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/fe-common/core/hilight-text.c b/src/fe-common/core/hilight-text.c index 87c5d467..72327777 100644 --- a/src/fe-common/core/hilight-text.c +++ b/src/fe-common/core/hilight-text.c @@ -484,10 +484,13 @@ static void hilight_print(int index, HILIGHT_REC *rec) GString *options; options = g_string_new(NULL); - if (!rec->nick || !rec->word) { + if (rec->nick || rec->word) { if (rec->nick) g_string_append(options, "-nick "); if (rec->word) g_string_append(options, "-word "); } + else if(rec->line) { + g_string_append(options, "-line "); + } if (rec->nickmask) g_string_append(options, "-mask "); if (rec->fullword) g_string_append(options, "-full "); From 5ade7a9e3349c65f88d5fa2cc1a8dcd44b839798 Mon Sep 17 00:00:00 2001 From: Jari Matilainen Date: Sun, 4 Oct 2015 17:47:53 +0200 Subject: [PATCH 2/3] Make /hilight list be specific with regards to -nick/-word/-line, v2 --- src/fe-common/core/hilight-text.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fe-common/core/hilight-text.c b/src/fe-common/core/hilight-text.c index 72327777..6af41e6f 100644 --- a/src/fe-common/core/hilight-text.c +++ b/src/fe-common/core/hilight-text.c @@ -484,11 +484,11 @@ static void hilight_print(int index, HILIGHT_REC *rec) GString *options; options = g_string_new(NULL); - if (rec->nick || rec->word) { + if (!(rec->nick && rec->word)) { if (rec->nick) g_string_append(options, "-nick "); if (rec->word) g_string_append(options, "-word "); } - else if(rec->line) { + else { g_string_append(options, "-line "); } From b6cd02019b76c9cdffc94baf4940eeb99926d9de Mon Sep 17 00:00:00 2001 From: Jari Matilainen Date: Sun, 4 Oct 2015 17:54:58 +0200 Subject: [PATCH 3/3] Make /hilight list be specific with regards to -nick/-word/-line, v3, logic improvements --- src/fe-common/core/hilight-text.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/fe-common/core/hilight-text.c b/src/fe-common/core/hilight-text.c index 6af41e6f..0fbc5a6d 100644 --- a/src/fe-common/core/hilight-text.c +++ b/src/fe-common/core/hilight-text.c @@ -484,13 +484,12 @@ static void hilight_print(int index, HILIGHT_REC *rec) GString *options; options = g_string_new(NULL); - if (!(rec->nick && rec->word)) { + if (!(rec->nick && rec->word)) + g_string_append(options, "-line "); + else { if (rec->nick) g_string_append(options, "-nick "); if (rec->word) g_string_append(options, "-word "); } - else { - g_string_append(options, "-line "); - } if (rec->nickmask) g_string_append(options, "-mask "); if (rec->fullword) g_string_append(options, "-full ");