From dd7737eee215855947144410eb8997fb30264d3b Mon Sep 17 00:00:00 2001 From: discomrade Date: Mon, 17 Jan 2022 11:14:04 -0100 Subject: [PATCH] Consider nonoko in building after posting, improve comments --- post.php | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/post.php b/post.php index 0eb1b2e4..3b6ba440 100644 --- a/post.php +++ b/post.php @@ -1440,28 +1440,25 @@ function handle_post(){ if ($config['try_smarter']) $build_pages = range(1, $config['max_pages']); + } - event('post-after', $post); - + event('post-after', $post); + + // If this is a new thread or the poster is returning to the index, let's build it before they redirect + if ($post['op'] || !$noko) + buildIndex(); + + // We are already done, let's continue our heavy-lifting work in the background (if we run off FastCGI) + if (function_exists('fastcgi_finish_request')) { + @fastcgi_finish_request(); + } + + if (!$post['op'] && $noko) buildIndex(); - - // We are already done and post is visible to others, let's continue our heavy-lifting work in the background (if we run off FastCGI) - if (function_exists('fastcgi_finish_request')) { - @fastcgi_finish_request(); - } + if ($post['op']) { rebuildThemes('post-thread', $board['uri']); - } else { - event('post-after', $post); - - // We are already done and post is visible to others, let's continue our heavy-lifting work in the background (if we run off FastCGI) - if (function_exists('fastcgi_finish_request')) { - @fastcgi_finish_request(); - } - - buildIndex(); - rebuildThemes('post', $board['uri']); } }