diff options
-rw-r--r-- | phpBB/includes/functions_posting.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 38f542264c..f920be9c4b 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1286,10 +1286,18 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id { $msg_users[] = $row; $update_notification[$row['notify_type']][] = $row['user_id']; + + /* + * We also update the forums watch table for this user when we are + * sending out a topic notification to prevent sending out another + * notification in case this user is also subscribed to the forum + * this topic was posted in. + * Since an UPDATE query is used, this has no effect on users only + * subscribed to the topic (i.e. no row is created) and should not + * be a performance issue. + */ if ($row['notify_type'] === 'topic') { - // Using SQL characteristics. If it didn't exist it isn't added. - // It's very rare to find someone that is registered in topic and noone is registered in the forum $update_notification['forum'][] = $row['user_id']; } } |