Don't fire the SERVER_NOTICE hook more than once per NOTICE

The previous code would fire the hook twice per NOTICE if handle_oper_vision()
didn't handle the NOTICE (eg. /set SWATCH NONE).
This commit is contained in:
Kevin Easton
2016-04-12 22:55:49 +10:00
parent 0b91d61496
commit d296739f6f
2 changed files with 7 additions and 19 deletions

View File

@@ -1,5 +1,7 @@
[Changes 1.2.2] [Changes 1.2.2]
* Don't fire the SERVER_NOTICE hook more than once per notice. (caf)
* Fix display of the OperView SWATCH flags variable. (caf) * Fix display of the OperView SWATCH flags variable. (caf)
* Update default /fset SERVER_NOTICE value to remove extra space. (caf) * Update default /fset SERVER_NOTICE value to remove extra space. (caf)

View File

@@ -608,32 +608,18 @@ static void parse_server_notice(const char *from, char *line)
reset_display_target(); reset_display_target();
else else
#endif #endif
if (strstr(line, "***"))
{ {
set_display_target(NULL, LOG_SNOTE); if (strstr(line, "***"))
#ifdef WANT_OPERVIEW
if (get_int_var(OV_VAR) && !(get_server_ircop_flags(from_server) & SERVER_CRAP))
goto done1;
#endif
if (do_hook(SERVER_NOTICE_LIST, flag ? "%s *** %s" : "%s %s", f, line))
{
next_arg(line, &line); next_arg(line, &line);
serversay(1, f, "%s", convert_output_format(
fget_string_var(FORMAT_SERVER_NOTICE_FSET), "%s %s %s", update_clock(GET_TIME), f, stripansicodes(line)));
add_last_type(&last_servermsg[0], MAX_LAST_MSG, NULL, NULL, NULL, line);
}
}
else
{
set_display_target(NULL, LOG_SNOTE); set_display_target(NULL, LOG_SNOTE);
#ifdef WANT_OPERVIEW #ifdef WANT_OPERVIEW
if (get_int_var(OV_VAR) && !(get_server_ircop_flags(from_server) & SERVER_CRAP)) if (get_int_var(OV_VAR) && !(get_server_ircop_flags(from_server) & SERVER_CRAP))
goto done1; goto done1;
#endif #endif
if (do_hook(SERVER_NOTICE_LIST, flag ? "%s *** %s" : "%s %s", f, line)) serversay(1, f, "%s", convert_output_format(
serversay(1, f, "%s", fget_string_var(FORMAT_SERVER_NOTICE_FSET), "%s %s %s",
convert_output_format(fget_string_var(FORMAT_SERVER_NOTICE_FSET), "%s %s %s", update_clock(GET_TIME), update_clock(GET_TIME), f, stripansicodes(line)));
f, stripansicodes(line)));
add_last_type(&last_servermsg[0], MAX_LAST_MSG, NULL, NULL, NULL, line); add_last_type(&last_servermsg[0], MAX_LAST_MSG, NULL, NULL, NULL, line);
} }
} }