Index: og.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/og/og.module,v
retrieving revision 1.367
diff -u -r1.367 og.module
--- og.module	9 Jul 2007 14:58:55 -0000	1.367
+++ og.module	7 Aug 2007 17:05:25 -0000
@@ -1333,7 +1333,16 @@
         og_save_ancestry($node);
       }
       
-      if (!module_exists('og2list')) {
+      $skip_notification = FALSE; 
+      // Any module that returns true from its hook_og_notify($node) will prevent sending notifications.
+      // og2list uses this to send its own notifications for groups with a mailing list.
+      foreach(module_implements('og_notify') as $module) {
+        if (module_invoke($module,'og_notify',$node)) {
+          $skip_notification = TRUE;
+          break;
+        }
+      }
+      if (!$skip_notification && $node->status && og_node_type_notify($node->type)) {
         if ($node->status && og_node_type_notify($node->type) && $node->og_groups) {
           if (module_exists('job_queue')) {
             $description = t('OG: notify group subscribers about node %nid - !link', array('%nid' => $node->nid, '!link' => l($node->title, "node/$node->nid")));
@@ -1625,8 +1634,18 @@
       $comment = (array) $comment;
       // fall through
     case 'insert':
-      if ($comment['status'] == COMMENT_PUBLISHED && !module_exists('og2list')) {
-        $node = node_load($comment['nid']);
+      $skip_notification = FALSE; 
+      // Any module that returns true from its hook_og_notify($node) will prevent sending notifications.
+      // og2list uses this to send its own notifications instead for mailing list content.
+      $node = node_load($comment['nid']);
+
+      foreach(module_implements('og_notify') as $module) {
+        if (module_invoke($module, 'og_notify', $node)) {
+          $skip_notification = TRUE;
+          break;
+        }
+      }
+      if ($comment['status'] == COMMENT_PUBLISHED && !$skip_notification) {
         if ($node->og_groups) {
           if (module_exists('job_queue')) {
             $description = t('OG: notify group subscribers about comment %id on !link', array('%id' => $comment['cid'], '!link' => l($node->title, "node/$node->nid", NULL, NULL, 'comment-'. $comment['cid'])));
