mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 20:33:46 +02:00
Applied patch from fs#275 to make /hilight -mask -line work properly
This commit is contained in:
parent
fc3c0a8420
commit
deb6ca1b1a
5 changed files with 23 additions and 12 deletions
|
|
@ -175,6 +175,7 @@ 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 */
|
||||
|
|
@ -187,8 +188,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_nick(server, target, nick, address, MSGLEVEL_PUBLIC, msg);
|
||||
color = (hilight == NULL) ? NULL : hilight_get_color(hilight);
|
||||
hilight_match(server, target, nick, address, MSGLEVEL_PUBLIC, msg, &match_beg, &match_end);
|
||||
color = (hilight == NULL || !hilight->nick) ? NULL : hilight_get_color(hilight);
|
||||
|
||||
print_channel = chanrec == NULL ||
|
||||
!window_item_is_active((WI_ITEM_REC *) chanrec);
|
||||
|
|
@ -214,10 +215,13 @@ static void sig_message_public(SERVER_REC *server, const char *msg,
|
|||
if (printnick == NULL)
|
||||
printnick = nick;
|
||||
|
||||
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;
|
||||
if (color != NULL) {
|
||||
/* highlighted nick */
|
||||
TEXT_DEST_REC dest;
|
||||
format_create_dest(&dest, server, target, level, NULL);
|
||||
hilight_update_text_dest(&dest,hilight);
|
||||
if (!print_channel) /* message to active channel in window */
|
||||
printformat_dest(&dest, TXT_PUBMSG_HILIGHT, color,
|
||||
|
|
@ -228,11 +232,11 @@ static void sig_message_public(SERVER_REC *server, const char *msg,
|
|||
nickmode);
|
||||
} else {
|
||||
if (!print_channel)
|
||||
printformat(server, target, level,
|
||||
printformat_dest(&dest,
|
||||
for_me ? TXT_PUBMSG_ME : TXT_PUBMSG,
|
||||
printnick, msg, nickmode);
|
||||
else
|
||||
printformat(server, target, level,
|
||||
printformat_dest(&dest,
|
||||
for_me ? TXT_PUBMSG_ME_CHANNEL :
|
||||
TXT_PUBMSG_CHANNEL,
|
||||
printnick, target, msg, nickmode);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue