Commit b9fbe23f authored by greggles's avatar greggles

task #334735 by recidive: Remove patching core dependency and only send...

task #334735 by recidive: Remove patching core dependency and only send notifications if a comment is truly published.
parent a54a4c4f
......@@ -232,10 +232,6 @@ function comment_notify_comment($comment, $op) {
form_set_error('mail', t('If you want to subscribe to comments you must supply a valid e-mail address.'));
}
break;
case 'publish':
// The real meat of the module.
_comment_notify_mailalert($comment);
break;
case 'update':
// In case they have changed their status, save it in the database.
$sql = 'UPDATE {comment_notify} SET notify = %d WHERE cid = %d';
......@@ -245,6 +241,10 @@ function comment_notify_comment($comment, $op) {
else {
db_query($sql, 0, $comment['cid']);
}
// And send notifications - the real purpose of the module.
if ($comment['status'] == COMMENT_PUBLISHED) {
_comment_notify_mailalert($comment);
}
break;
case 'insert':
// For new comments, we first build up a string to be used as the identifier for the alert
......@@ -264,6 +264,10 @@ function comment_notify_comment($comment, $op) {
// And then save the data.
db_query("INSERT INTO {comment_notify} (cid, notify, notify_hash) values (%d, %d, '%s')", $comment['cid'], $notify, $notify_hash);
// And send notifications - the real purpose of the module.
if ($comment['status'] == COMMENT_PUBLISHED) {
_comment_notify_mailalert($comment);
}
break;
case 'delete':
db_query("DELETE FROM {comment_notify} WHERE cid = %d", $comment->cid);
......
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