diff options
Diffstat (limited to 'src/fe-common/core')
-rw-r--r-- | src/fe-common/core/command-history.c | 10 | ||||
-rw-r--r-- | src/fe-common/core/fe-ignore.c | 8 | ||||
-rw-r--r-- | src/fe-common/core/fe-messages.c | 10 | ||||
-rw-r--r-- | src/fe-common/core/formats.c | 2 | ||||
-rw-r--r-- | src/fe-common/core/formats.h | 5 | ||||
-rw-r--r-- | src/fe-common/core/hilight-text.c | 7 | ||||
-rw-r--r-- | src/fe-common/core/window-commands.c | 4 |
7 files changed, 16 insertions, 30 deletions
diff --git a/src/fe-common/core/command-history.c b/src/fe-common/core/command-history.c index 9f46ee99..1060744e 100644 --- a/src/fe-common/core/command-history.c +++ b/src/fe-common/core/command-history.c @@ -33,7 +33,6 @@ static HISTORY_REC *global_history; static int window_history; static GSList *histories; -static HISTORY_REC *last_cleared_history; void command_history_add(HISTORY_REC *history, const char *text) { @@ -42,13 +41,6 @@ void command_history_add(HISTORY_REC *history, const char *text) g_return_if_fail(history != NULL); g_return_if_fail(text != NULL); - if (last_cleared_history == history) { - last_cleared_history = NULL; - return; /* ignore this history addition, we just - cleared it */ - } - last_cleared_history = NULL; - link = g_list_last(history->list); if (link != NULL && g_strcmp0(link->data, text) == 0) return; /* same as previous entry */ @@ -195,7 +187,6 @@ void command_history_clear(HISTORY_REC *history) g_list_free(history->list); history->list = NULL; history->lines = 0; - last_cleared_history = history; } void command_history_destroy(HISTORY_REC *history) @@ -207,7 +198,6 @@ void command_history_destroy(HISTORY_REC *history) histories = g_slist_remove(histories, history); command_history_clear(history); - last_cleared_history = NULL; /* was destroyed */ g_free_not_null(history->name); g_free(history); diff --git a/src/fe-common/core/fe-ignore.c b/src/fe-common/core/fe-ignore.c index d2f9de27..a809ac91 100644 --- a/src/fe-common/core/fe-ignore.c +++ b/src/fe-common/core/fe-ignore.c @@ -158,8 +158,8 @@ static void cmd_ignore(const char *data) channels = (chanarg == NULL || *chanarg == '\0') ? NULL : g_strsplit(chanarg, ",", -1); - rec = patternarg != NULL ? NULL: ignore_find_noact(servertag, mask, channels, - (level & MSGLEVEL_NO_ACT)); + rec = ignore_find_full(servertag, mask, patternarg, channels, + IGNORE_FIND_PATTERN | ((level & MSGLEVEL_NO_ACT) ? IGNORE_FIND_NOACT : 0)); new_ignore = rec == NULL; if (rec == NULL) { @@ -237,9 +237,9 @@ static void cmd_unignore(const char *data) chans[0] = mask; mask = NULL; } - rec = ignore_find_noact("*", mask, (char **) chans, 0); + rec = ignore_find_full("*", mask, NULL, (char **) chans, 0); if (rec == NULL) { - rec = ignore_find_noact("*", mask, (char **) chans, 1); + rec = ignore_find_full("*", mask, NULL, (char **) chans, IGNORE_FIND_NOACT); } } diff --git a/src/fe-common/core/fe-messages.c b/src/fe-common/core/fe-messages.c index e06a4571..3240fd10 100644 --- a/src/fe-common/core/fe-messages.c +++ b/src/fe-common/core/fe-messages.c @@ -175,7 +175,6 @@ static void sig_message_public(SERVER_REC *server, const char *msg, int for_me, print_channel, level; char *nickmode, *color, *freemsg = NULL; HILIGHT_REC *hilight; - int match_beg = 0, match_end = 0; /* NOTE: this may return NULL if some channel is just closed with /WINDOW CLOSE and server still sends the few last messages */ @@ -188,8 +187,8 @@ static void sig_message_public(SERVER_REC *server, const char *msg, nick_match_msg(chanrec, msg, server->nick) : nick_match_msg_everywhere(chanrec, msg, server->nick); hilight = for_me ? NULL : - hilight_match(server, target, nick, address, MSGLEVEL_PUBLIC, msg, &match_beg, &match_end); - color = (hilight == NULL || !hilight->nick) ? NULL : hilight_get_color(hilight); + hilight_match_nick(server, target, nick, address, MSGLEVEL_PUBLIC, msg); + color = (hilight == NULL) ? NULL : hilight_get_color(hilight); print_channel = chanrec == NULL || !window_item_is_active((WI_ITEM_REC *) chanrec); @@ -217,9 +216,8 @@ static void sig_message_public(SERVER_REC *server, const char *msg, TEXT_DEST_REC dest; format_create_dest(&dest, server, target, level, NULL); - dest.hilight = hilight; - dest.match_beg = match_beg; - dest.match_end = match_end; + dest.address = address; + dest.nick = nick; if (color != NULL) { /* highlighted nick */ hilight_update_text_dest(&dest,hilight); diff --git a/src/fe-common/core/formats.c b/src/fe-common/core/formats.c index b95b3966..ccf48394 100644 --- a/src/fe-common/core/formats.c +++ b/src/fe-common/core/formats.c @@ -416,8 +416,6 @@ void format_create_dest_tag(TEXT_DEST_REC *dest, void *server, dest->server_tag = server != NULL ? SERVER(server)->tag : server_tag; dest->target = target; dest->level = level; - dest->match_beg = 0; - dest->match_end = 0; dest->window = window != NULL ? window : window_find_closest(server, target, level); } diff --git a/src/fe-common/core/formats.h b/src/fe-common/core/formats.h index a4b26852..8efd204c 100644 --- a/src/fe-common/core/formats.h +++ b/src/fe-common/core/formats.h @@ -52,11 +52,10 @@ typedef struct _TEXT_DEST_REC { SERVER_REC *server; const char *server_tag; /* if server is non-NULL, must be server->tag */ const char *target; + const char *nick; + const char *address; int level; - HILIGHT_REC *hilight; - int match_beg; - int match_end; int hilight_priority; char *hilight_color; int flags; diff --git a/src/fe-common/core/hilight-text.c b/src/fe-common/core/hilight-text.c index 2c0075ec..b746f636 100644 --- a/src/fe-common/core/hilight-text.c +++ b/src/fe-common/core/hilight-text.c @@ -325,9 +325,10 @@ static void sig_print_text(TEXT_DEST_REC *dest, const char *text, if (dest->level & MSGLEVEL_NOHILIGHT) return; - hilight_start = dest->match_beg; - hilight_end = dest->match_end; - hilight = dest->hilight; + hilight_start = hilight_end = 0; + hilight = hilight_match(dest->server, dest->target, dest->nick, + dest->address, dest->level, stripped, + &hilight_start, &hilight_end); if (hilight == NULL) return; diff --git a/src/fe-common/core/window-commands.c b/src/fe-common/core/window-commands.c index e5005144..9e4aab3a 100644 --- a/src/fe-common/core/window-commands.c +++ b/src/fe-common/core/window-commands.c @@ -620,10 +620,10 @@ static void cmd_window_name(const char *data) void cmd_window_history(const char *data) { GHashTable *optlist; - char *name; + char *name; void *free_arg; - if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS, + if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS | PARAM_FLAG_STRIP_TRAILING_WS, "window history", &optlist, &name)) return; |