Commit 82bf62b9 authored by moonray's avatar moonray Committed by greggles

Issue #1278556 by moonray | Wim Leers: Two copies of notification, mark as...

Issue #1278556 by moonray | Wim Leers: Two copies of notification, mark as notified only updates DB, not passed object
parent 7c5a17a3
......@@ -205,12 +205,16 @@ function comment_notify_get_watchers($nid) {
* @param integer $cid
* @return boolean
*/
function comment_notify_mark_comment_as_notified($cid) {
function comment_notify_mark_comment_as_notified($comment) {
// First, mark the passed comment (an object, so passed by reference).
$comment->notified = 1;
// Next, store this fact in the DB as well.
return (bool)db_update('comment_notify')
->fields(array(
'notified' => 1,
))
->condition('cid', $cid)
->condition('cid', $comment->cid)
->execute();
}
......
......@@ -540,8 +540,7 @@ function _comment_notify_mailalert($comment) {
}
// Record that a notification was sent for this comment so that
// notifications aren't sent again if the comment is later edited.
comment_notify_mark_comment_as_notified($cid);
comment_notify_mark_comment_as_notified($comment);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment