From 3315702b5f2feacbc703f5dcee5944f89cf2d407 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 7 Apr 2014 19:13:32 +0200 Subject: [PATCH] [ticket/12370] Do not delete topic notifications when the topic is visible We should only delete the topic notifications, when the topic is not approved anymore. This happens, when the post was the last approved but is now unapproved because the user is on queue, or when it has been softdeleted while editing. PHPBB3-12370 --- phpBB/includes/functions_posting.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 6a0aedf8c6..79fcb892ef 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -2272,8 +2272,10 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u case 'edit_first_post': case 'edit': case 'edit_last_post': - // @todo: Check whether these notification deletions are correct - $phpbb_notifications->delete_notifications('topic', $data['topic_id']); + if ($data['topic_visibility'] != ITEM_APPROVED) + { + $phpbb_notifications->delete_notifications('topic', $data['topic_id']); + } $phpbb_notifications->delete_notifications(array( 'quote', @@ -2297,8 +2299,10 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u case 'edit_first_post': case 'edit': case 'edit_last_post': - // @todo: Check whether these notification deletions are correct - $phpbb_notifications->delete_notifications('topic', $data['topic_id']); + if ($data['topic_visibility'] != ITEM_APPROVED) + { + $phpbb_notifications->delete_notifications('topic', $data['topic_id']); + } $phpbb_notifications->delete_notifications(array( 'quote',