just above the line (around line 370) " if (db_result(db_query('SELECT cid from {comment_notify} WHERE cid = %d AND notified = %d', $cid, 1))) {
return;
}"

ADD:
// Check to see if cave module exist, and if so, if the author is caved,
// don't send any email's and return
if(module_exists('cave') && $user->cave == 1){
return;
}

CommentFileSizeAuthor
#3 commnet_notify_patch-6.x.1.4.txt799 bytespanthar

Comments

greggles’s picture

Status: Needs review » Needs work

Thanks for your feature request and for helping make this a better module. Could you provide this as a patch?

greggles’s picture

Also, I'd really rather do the check for cave module in a more generic way if possible. Maybe check for any modules that implement hook_db_rewrite_sql?

panthar’s picture

StatusFileSize
new799 bytes

Updated code to use module_implements('db_rewrite_sql') (insert in same spot):

I added a patch I generated from winmerge (I assume it will work), let me know if there is any issues.

Thanks

philpro’s picture

Was this patch ever committed? I've just updated comment notify and troll and emails of caved trolls are still going out.

greggles’s picture

If I commit something I mark the issue as fixed.

Do you mean your code from #1 or the patch from #3.

The code from #1 won't get committed because it is too specific to cave module (per my comment in #2).

The code from #3 won't get committed because nobody has reviewed it and it is still too specific. It also misses on style points (comments should be capitalized and end in periods, spacing after the if).

What I asked panthar to do in irc when he posted this was

1. If there's a module that implements hook_db_rewrite_sql
2. Change users to be the user receiving the message
3. Run a query on the comment table to see if that user can see this comment
4. Switch users back

This idea should work for any module that does something like cave making it a better solution.