Only send thread_id property if we have a thread
Null values are not allowed
This commit is contained in:
parent
3fa80c6e39
commit
d6831782b5
|
@ -108,6 +108,7 @@ $config['spam']['enabled'] = true;
|
||||||
$config['spam_noticer']['enabled'] = true;
|
$config['spam_noticer']['enabled'] = true;
|
||||||
$config['spam_noticer']['base_url'] = 'http://localhost:8300';
|
$config['spam_noticer']['base_url'] = 'http://localhost:8300';
|
||||||
$config['spam_noticer']['ui_url'] = 'https://dev-spamnoticer.leftychan.net/static/index.html';
|
$config['spam_noticer']['ui_url'] = 'https://dev-spamnoticer.leftychan.net/static/index.html';
|
||||||
|
$config['spam_noticer']['imageboard_root'] = 'http://dev.leftychan.net/';
|
||||||
$config['spam_noticer']['website_name'] = "leftychan_dev";
|
$config['spam_noticer']['website_name'] = "leftychan_dev";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -505,5 +506,4 @@ $config['filters'][] = array(
|
||||||
);
|
);
|
||||||
|
|
||||||
$config['global_message'] = '<p><a href="https://talk.leftychan.net/#/room/#welcome:matrix.leftychan.net" class="redtext"><span class="heading">Matrix</span></a></p><p><a href="ircs://irc.leftychan.net:6697/#leftychan" class="redtext"><span class="heading">IRC Chat</span></a></p><p><a href="mumble://leftychan.net" class="redtext"><span class="heading">Mumble</span></a></p><p><a href="https://t.me/+RegtyzzrE0M1NDMx" class="red text"><span class="heading">Telegram</a></span></p><p><a href="https://discord.gg/AcZeFKXPmZ" class="redtext"><span class="heading">Discord</a></span></p>';
|
$config['global_message'] = '<p><a href="https://talk.leftychan.net/#/room/#welcome:matrix.leftychan.net" class="redtext"><span class="heading">Matrix</span></a></p><p><a href="ircs://irc.leftychan.net:6697/#leftychan" class="redtext"><span class="heading">IRC Chat</span></a></p><p><a href="mumble://leftychan.net" class="redtext"><span class="heading">Mumble</span></a></p><p><a href="https://t.me/+RegtyzzrE0M1NDMx" class="red text"><span class="heading">Telegram</a></span></p><p><a href="https://discord.gg/AcZeFKXPmZ" class="redtext"><span class="heading">Discord</a></span></p>';
|
||||||
$config['spam_noticer']['website_name'] = "leftychan_dev";
|
|
||||||
$config['debug'] = true;
|
$config['debug'] = true;
|
||||||
|
|
|
@ -1821,7 +1821,6 @@ function mod_ban_post(string $board, $delete, $post_num, $token = false) {
|
||||||
$po,
|
$po,
|
||||||
$board,
|
$board,
|
||||||
$spamnoticer_info);
|
$spamnoticer_info);
|
||||||
print_err('$spamnoticer_result: ' . $spamnoticer_result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$will_ban = $spamnoticer_info->ban;
|
$will_ban = $spamnoticer_info->ban;
|
||||||
|
|
|
@ -108,10 +108,12 @@ function addToSpamNoticer($config, $post, $boardname, BanFormFieldsForSpamnotice
|
||||||
'time_stamp' => $post->time,
|
'time_stamp' => $post->time,
|
||||||
'website_name' => $config['spam_noticer']['website_name'],
|
'website_name' => $config['spam_noticer']['website_name'],
|
||||||
'board_name' => $boardname,
|
'board_name' => $boardname,
|
||||||
'thread_id' => isset($post->thread) ? $post->thread : NULL,
|
|
||||||
'reporter_name' => getUsername()
|
'reporter_name' => getUsername()
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if (isset($post->thread)) {
|
||||||
|
$json_payload['thread_id'] = $post->thread;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$multipart = array();
|
$multipart = array();
|
||||||
|
@ -164,10 +166,13 @@ function checkWithSpamNoticer($config, $post, $boardname) {
|
||||||
'time_stamp' => time(),
|
'time_stamp' => time(),
|
||||||
'website_name' => $config['spam_noticer']['website_name'],
|
'website_name' => $config['spam_noticer']['website_name'],
|
||||||
'board_name' => $boardname,
|
'board_name' => $boardname,
|
||||||
'thread_id' => array_key_exists('thread', $post) ? $post['thread'] : NULL,
|
|
||||||
'delete_token' => $post['delete_token'],
|
'delete_token' => $post['delete_token'],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if (array_key_exists('thread', $post)) {
|
||||||
|
$json_payload['thread_id'] = $post['thread'];
|
||||||
|
}
|
||||||
|
|
||||||
$result = new SpamNoticerResult();
|
$result = new SpamNoticerResult();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue