summaryrefslogtreecommitdiff
path: root/src/fe-common
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-07-09 14:25:03 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-07-09 14:25:03 +0000
commit885790d08a5b3f56b2d27a6cf983ee7de6131644 (patch)
treeb2a94460f72d4e15f27d88549252a13fcca799d4 /src/fe-common
parentcc8ddca1228239add1cba3869855aa947035d44d (diff)
downloadirssi-885790d08a5b3f56b2d27a6cf983ee7de6131644.zip
Don't add the highlighted window to activity list if it's the current
window.. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@447 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common')
-rw-r--r--src/fe-common/core/hilight-text.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/fe-common/core/hilight-text.c b/src/fe-common/core/hilight-text.c
index 881a3be7..b3a3a356 100644
--- a/src/fe-common/core/hilight-text.c
+++ b/src/fe-common/core/hilight-text.c
@@ -31,7 +31,7 @@
#include "hilight-text.h"
-#define DEFAULT_HILIGHT_CHECK_LEVEL \
+#define DEFAULT_HILIGHT_LEVEL \
(MSGLEVEL_PUBLIC | MSGLEVEL_MSGS | MSGLEVEL_NOTICES | MSGLEVEL_ACTIONS)
static int hilight_next;
@@ -199,7 +199,7 @@ char *hilight_match(const char *channel, const char *nickmask, int level, const
for (tmp = hilights; tmp != NULL; tmp = tmp->next) {
HILIGHT_REC *rec = tmp->data;
- if ((level & (rec->level > 0 ? rec->level : DEFAULT_HILIGHT_CHECK_LEVEL)) == 0)
+ if ((level & (rec->level > 0 ? rec->level : DEFAULT_HILIGHT_LEVEL)) == 0)
continue;
if ((rec->nick && nickmask == NULL) ||
(!rec->nick && nickmask != NULL))
@@ -260,10 +260,12 @@ static void sig_print_text_stripped(WINDOW_REC *window, SERVER_REC *server, cons
window->last_color = atoi(color+1);
}
- oldlevel = window->new_data;
- window->new_data = NEWDATA_HILIGHT;
- signal_emit("window hilight", 2, window, GINT_TO_POINTER(oldlevel));
- signal_emit("window activity", 2, window, GINT_TO_POINTER(oldlevel));
+ if (window != active_win) {
+ oldlevel = window->new_data;
+ window->new_data = NEWDATA_HILIGHT;
+ signal_emit("window hilight", 2, window, GINT_TO_POINTER(oldlevel));
+ signal_emit("window activity", 2, window, GINT_TO_POINTER(oldlevel));
+ }
hilight_next = FALSE;
@@ -397,22 +399,23 @@ static void cmd_hilight(const char *data)
hilights = g_slist_remove(hilights, rec);
}
- hilights = g_slist_append(hilights, rec);
- rec->nick = settings_get_bool("hilight_only_nick") ?
+ rec->level = (levelarg == NULL || *levelarg == '\0') ? 0 :
+ level2bits(replace_chars(levelarg, ',', ' '));
+ rec->nick = settings_get_bool("hilight_only_nick") &&
+ (rec->level == 0 || (rec->level & DEFAULT_HILIGHT_LEVEL) == rec->level) ?
g_hash_table_lookup(optlist, "nonick") == NULL :
g_hash_table_lookup(optlist, "nick") != NULL;
rec->nickmask = g_hash_table_lookup(optlist, "mask") != NULL;
rec->fullword = g_hash_table_lookup(optlist, "word") != NULL;
rec->regexp = g_hash_table_lookup(optlist, "regexp") != NULL;
- rec->level = (levelarg == NULL || *levelarg == '\0') ? 0 :
- level2bits(replace_chars(levelarg, ',', ' '));
if (colorarg != NULL && *colorarg != '\0')
rec->color = g_strdup(colorarg);
- hilight_print(g_slist_index(hilights, rec)+1, rec);
-
+ hilights = g_slist_append(hilights, rec);
hilight_add_config(rec);
+
+ hilight_print(g_slist_index(hilights, rec)+1, rec);
cmd_params_free(free_arg);
}