print_err only when spamnoticer didn't succeed (reduce noise)
This commit is contained in:
parent
237b4ff1c7
commit
45dc42692f
|
@ -271,9 +271,6 @@ function checkWithSpamNoticer($config, $post, $boardname) {
|
||||||
|
|
||||||
$status_code = $response->getStatusCode();
|
$status_code = $response->getStatusCode();
|
||||||
|
|
||||||
print_err("spamnoticer status code: " . $status_code);
|
|
||||||
print_err("spamnoticer response body: " . $response->getBody());
|
|
||||||
|
|
||||||
if ($status_code >= 200 && $status_code < 300) {
|
if ($status_code >= 200 && $status_code < 300) {
|
||||||
$result->succeeded = true;
|
$result->succeeded = true;
|
||||||
$result->result_json = json_decode($response->getBody(), true);
|
$result->result_json = json_decode($response->getBody(), true);
|
||||||
|
@ -286,6 +283,9 @@ function checkWithSpamNoticer($config, $post, $boardname) {
|
||||||
$result->reason = renderReasons($reasons_bitmap);
|
$result->reason = renderReasons($reasons_bitmap);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
print_err("spamnoticer status code: " . $status_code);
|
||||||
|
print_err("spamnoticer response body: " . $response->getBody());
|
||||||
|
|
||||||
$result->reason = (string) $response->getBody();
|
$result->reason = (string) $response->getBody();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
6
post.php
6
post.php
|
@ -982,13 +982,9 @@ function handle_post(){
|
||||||
|
|
||||||
$spam_noticer_result = checkWithSpamNoticer($config, $post, $board['uri']);
|
$spam_noticer_result = checkWithSpamNoticer($config, $post, $board['uri']);
|
||||||
|
|
||||||
if ($spam_noticer_result->succeeded) {
|
if ($spam_noticer_result->succeeded && $spam_noticer_result->noticed) {
|
||||||
if ($spam_noticer_result->noticed) {
|
|
||||||
error($config['error']['spam_noticer'] . $spam_noticer_result->reason);
|
error($config['error']['spam_noticer'] . $spam_noticer_result->reason);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
print_err($spam_noticer_result->reason);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hasPermission($config['mod']['bypass_filters'], $board['uri']) && !$dropped_post) {
|
if (!hasPermission($config['mod']['bypass_filters'], $board['uri']) && !$dropped_post) {
|
||||||
|
|
Loading…
Reference in New Issue