From f0cbe53a2a0dfe973358af498fed22effbdc9e97 Mon Sep 17 00:00:00 2001 From: "Janus B. Kristensen" Date: Mon, 16 May 2005 08:09:37 +0000 Subject: [PATCH] Don't send reply-notifications to the user who posted the reply. svn path=/trunk/boinc/; revision=6169 --- checkin_notes | 12 ++++++++++++ html/inc/subscribe.inc | 13 +++++++++++-- html/user/forum_reply.php | 2 +- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/checkin_notes b/checkin_notes index c799829def..aca142b9c8 100755 --- a/checkin_notes +++ b/checkin_notes @@ -6646,3 +6646,15 @@ David 15 May 2005 client/ cs_scheduler.C scheduler_op.C,h + +Janus 16 May 2005 + - Don't send reply-notifications in the forum to the user who posted the + reply, this just adds needless datatransfer for sending the mail and + later because the user will check if there actually was a reply... + + html/ + inc/ + subsribe.inc + user/ + forum_reply.php + diff --git a/html/inc/subscribe.inc b/html/inc/subscribe.inc index d84f4ba145..d3957a9434 100644 --- a/html/inc/subscribe.inc +++ b/html/inc/subscribe.inc @@ -67,8 +67,17 @@ function show_result_page($action, $success, $thread) { } -function notify_subscribers($threadID) { - $sql = "SELECT DISTINCT * FROM subscriptions WHERE threadid = " . $threadID; +/** + * Notify everyone who has subscriped except the user object specified in the optional + * parameter $except_user. + **/ +function notify_subscribers($threadID, $except_user=null) { + if ($except_user){ + $extra = " and userid!=".intval($except_user->id); + } else { + $extra = ""; + } + $sql = "SELECT DISTINCT * FROM subscriptions WHERE threadid = " . $threadID.$extra; $result = mysql_query($sql); while ($row = mysql_fetch_object($result)) { diff --git a/html/user/forum_reply.php b/html/user/forum_reply.php index c3887fbcd1..2f0df92458 100644 --- a/html/user/forum_reply.php +++ b/html/user/forum_reply.php @@ -85,7 +85,7 @@ if (!empty($_POST['content'])) { } replyToThread($thread_id, $logged_in_user->id, $_POST['content'], $parent_post, $add_signature); - notify_subscribers($thread_id); + notify_subscribers($thread_id, $logged_in_user); //Notify all subscribers except the user who posted (if the user has also subscribed) header('Location: forum_thread.php?id='.$thread_id); }