[ticket/11772] Do not send out new topic/post notifications when reapproving

Only add notifications, if we are not reapproving post
When the topic was already approved, but was edited and
now needs re-approval, we don't want to notify the users again.

PHPBB3-11772
This commit is contained in:
Joas Schilling 2014-04-11 14:26:55 +02:00
parent 2ec9c08a2b
commit 5512e62c3c

View file

@ -660,11 +660,18 @@ class mcp_queue
} }
$phpbb_notifications->delete_notifications('post_in_queue', $post_id); $phpbb_notifications->delete_notifications('post_in_queue', $post_id);
// Only add notifications, if we are not reapproving post
// When the topic was already approved, but was edited and
// now needs re-approval, we don't want to notify the users
// again.
if ($post_data['post_visibility'] == ITEM_UNAPPROVED)
{
$phpbb_notifications->add_notifications(array( $phpbb_notifications->add_notifications(array(
'quote', 'quote',
'bookmark', 'bookmark',
'post', 'post',
), $post_data); ), $post_data);
}
$phpbb_notifications->mark_notifications_read(array( $phpbb_notifications->mark_notifications_read(array(
'quote', 'quote',
@ -832,10 +839,18 @@ class mcp_queue
)); ));
$phpbb_notifications->delete_notifications('topic_in_queue', $topic_id); $phpbb_notifications->delete_notifications('topic_in_queue', $topic_id);
// Only add notifications, if we are not reapproving post
// When the topic was already approved, but was edited and
// now needs re-approval, we don't want to notify the users
// again.
if ($topic_data['topic_visibility'] == ITEM_UNAPPROVED)
{
$phpbb_notifications->add_notifications(array( $phpbb_notifications->add_notifications(array(
'quote', 'quote',
'topic', 'topic',
), $topic_data); ), $topic_data);
}
$phpbb_notifications->mark_notifications_read('quote', $topic_data['post_id'], $user->data['user_id']); $phpbb_notifications->mark_notifications_read('quote', $topic_data['post_id'], $user->data['user_id']);
$phpbb_notifications->mark_notifications_read('topic', $topic_id, $user->data['user_id']); $phpbb_notifications->mark_notifications_read('topic', $topic_id, $user->data['user_id']);