Don't mangle ANSI sequences in NOTICEs.

We pass through ANSI just fine in PRIVMSGs, so we might as well treat
NOTICEs the same way too.  The old code wasn't just stripping them out,
either - it was turning them into printable garbage.
This commit is contained in:
Kevin Easton
2015-09-01 23:04:01 +10:00
parent 75bd647d15
commit d1816fdc8b
2 changed files with 7 additions and 7 deletions

View File

@@ -1,5 +1,7 @@
[Changes 1.2.2]
* Don't mangle ANSI sequences in NOTICEs. (caf)
* Use BitchX.kill in all cases for random /KILL messages, and install a
copy of this file. (caf)

View File

@@ -678,8 +678,6 @@ void parse_notice(char *from, char **Args)
NickList *nick = NULL;
ChannelList *tmpc = NULL;
char *newline = NULL;
PasteArgs(Args, 1);
to = Args[0];
@@ -743,11 +741,11 @@ void parse_notice(char *from, char **Args)
{
char *free_me = NULL;
char *s;
free_me = newline = stripansi(line);
if (wild_match("[*Wall*", line))
{
char *free_me = stripansi(line);
char *newline = free_me;
char *channel = NULL, *p, *q;
q = p = next_arg(newline, &newline);
if ((p = strchr(p, '/')))
@@ -777,18 +775,19 @@ void parse_notice(char *from, char **Args)
logmsg(LOG_WALL, from, 0, "%s", line);
/* addtabkey(from, "wall", 0);*/
new_free(&channel);
new_free(&free_me);
}
else
{
if (type == PUBLIC_NOTICE_LIST)
{
s = convert_output_format(fget_string_var(check_auto_reply(line)?FORMAT_PUBLIC_NOTICE_AR_FSET:FORMAT_PUBLIC_NOTICE_FSET), "%s %s %s %s %s", update_clock(GET_TIME), from, FromUserHost, to, newline);
s = convert_output_format(fget_string_var(check_auto_reply(line)?FORMAT_PUBLIC_NOTICE_AR_FSET:FORMAT_PUBLIC_NOTICE_FSET), "%s %s %s %s %s", update_clock(GET_TIME), from, FromUserHost, to, line);
if (do_hook(type, "%s %s %s", from, to, line))
put_it("%s", s);
}
else
{
s = convert_output_format(fget_string_var(FORMAT_NOTICE_FSET), "%s %s %s %s", update_clock(GET_TIME), from, FromUserHost, newline);
s = convert_output_format(fget_string_var(FORMAT_NOTICE_FSET), "%s %s %s %s", update_clock(GET_TIME), from, FromUserHost, line);
if (do_hook(type, "%s %s", from, line))
put_it("%s", s);
@@ -798,7 +797,6 @@ void parse_notice(char *from, char **Args)
logmsg(LOG_NOTICE, from, 0, "%s", line);
add_last_type(&last_notice[0], MAX_LAST_MSG, from, FromUserHost, to, line);
}
new_free(&free_me);
}
notice_cleanup: