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();
|
||||
|
||||
print_err("spamnoticer status code: " . $status_code);
|
||||
print_err("spamnoticer response body: " . $response->getBody());
|
||||
|
||||
if ($status_code >= 200 && $status_code < 300) {
|
||||
$result->succeeded = true;
|
||||
$result->result_json = json_decode($response->getBody(), true);
|
||||
|
@ -286,6 +283,9 @@ function checkWithSpamNoticer($config, $post, $boardname) {
|
|||
$result->reason = renderReasons($reasons_bitmap);
|
||||
}
|
||||
} else {
|
||||
print_err("spamnoticer status code: " . $status_code);
|
||||
print_err("spamnoticer response body: " . $response->getBody());
|
||||
|
||||
$result->reason = (string) $response->getBody();
|
||||
}
|
||||
|
||||
|
|
8
post.php
8
post.php
|
@ -982,12 +982,8 @@ function handle_post(){
|
|||
|
||||
$spam_noticer_result = checkWithSpamNoticer($config, $post, $board['uri']);
|
||||
|
||||
if ($spam_noticer_result->succeeded) {
|
||||
if ($spam_noticer_result->noticed) {
|
||||
error($config['error']['spam_noticer'] . $spam_noticer_result->reason);
|
||||
}
|
||||
} else {
|
||||
print_err($spam_noticer_result->reason);
|
||||
if ($spam_noticer_result->succeeded && $spam_noticer_result->noticed) {
|
||||
error($config['error']['spam_noticer'] . $spam_noticer_result->reason);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue