[ticket/8652] Comment for also updating forum watch table in user_notification.

PHPBB3-8652
This commit is contained in:
Andreas Fischer 2012-03-02 00:19:42 +01:00
parent 470b79c9e3
commit b74530259f

View file

@ -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'];
}
}