I was getting duplication notifications, and found what seem to be two minor bugs in subscriptions.module:

#1 is that subscriptions_mailvars is checking strsent to avoid duplication, but using !strpos(...) instead of strpos() === false, so you can get dups to the first recipient matching at position 0. Should be:

    while ($subscriptions = db_fetch_object($result)) {
      if ($subscriptions->uid != $uid && !is_null($sid) && strpos($strsent , '!'. $subscriptions->uid .'!') === false) {
        ...

#2 is that subscriptions_comment is initializing strsent with empty string, should be an exclam to allow first user to match:

    function subscriptions_comment($op, $comment) {
      global $user;
      $strsent = '!';
      ...

Finally, question - any idea why subscriptions_comment hook isn't getting called for comment updates, eg. when you edit a comment? It looks like it should be from comments.module but it never gets called.

Comments

TDobes’s picture

Assigned: Unassigned » TDobes

Your first two issues have been fixed. Thank you for pointing them out.

I'm fairly certain that your third issue is a result of comment.module not always passing comment status... I've temporarily commented this part of the code out until this problem is fixed in comment.module. If this doesn't fix the problem for you, please re-open this issue.

Anonymous’s picture