--- notify.module_090320        Fri Mar 20 15:07:12 2009
+++ notify.module       Sat Mar 21 17:25:17 2009
@@ -368,7 +369,8 @@ function _notify_send() {
     _notify_switch_user($user->uid);

     // Fetch all new nodes and 'load' it to get proper body, etc.
-    $nresult = db_query(db_rewrite_sql('SELECT n.nid FROM {node} n WHERE (n.status = 1 OR n.moderate = 1) AND n.created > %d AND n.created <= %d ORDER BY n.created'), $period, time());
+  //$nresult = db_query(db_rewrite_sql('SELECT n.nid FROM {node} n WHERE (n.status = 1 OR n.moderate = 1) AND n.created > %d AND n.created <= %d ORDER BY n.created'), $period, time());
+    $nresult = db_query(db_rewrite_sql('SELECT n.nid FROM {node} n WHERE (n.status = 1 OR n.moderate = 1) AND ((n.created > %d AND n.created <= %d) OR (n.changed > %d AND n.changed <= %d)) ORDER BY n.created, n.changed'), $period, time(), $period, time());
     $nodes = array();
     while ($node = db_fetch_object($nresult)) {
       $nodes[$node->nid] = node_load($node->nid);
@@ -407,7 +409,27 @@ function _notify_send() {
           $node_body .= $mini_separator ."\n\n";
         }
         $node_body .= ++$node_count .'. '. $node->title ."\n";
-        $node_body .= t('!status !type by !author', array('!status' => $status, '!type' => node_get_types('name', $node), '!author' => ($node->name ? $node->name : variable_get('anonymous', 'Anonymous')))) ."\n";
+//        $node_body .= t('!status !type by !author', array('!status' => $status, '!type' => node_get_types('name', $node), '!author' => ($node->name ? $node->name : variable_get('anonymous', 'Anonymous')))) ."\n";
+
+        // Get author of most recent revision
+        $rev_author = "unknown";
+        $rev_author_query = 'SELECT u.name FROM {node_revisions} r INNER JOIN {node} n ON r.vid = n.vid INNER JOIN {users} u ON r.uid = u.uid WHERE n.nid = ' . $node->nid;
+        $rev_author_name = db_result(db_query($rev_author_query));
+        if ($rev_author_name) {
+          $rev_author = $rev_author_name;
+        }
+
+       // Print the revision author in the email message
+        if ($rev_author == "unknown") {
+          $node_body .= t('!status !type by !author', array('!status' => $status, '!type' => node_get_types('name', $node), '!author' => ($node->name ? $node->name : variable_get('anonymous', 'Anonymous')))) ."\n";
+        }
+        else {
+          $node_body .= t('!status !type created by !author and edited by !rev_author',
+            array('!status' => $status,
+                  '!type' => node_get_types('name', $node),
+                  '!author' => ($node->name ? $node->name : variable_get('anonymous', 'Anonymous')), '!rev_author' => $rev_author)) . "\n";
+        }
+
         $node_body .= '[ '. url('node/'. $node->nid, NULL, NULL, TRUE) ." ]\n\n";
         $node_body .= _notify_content($node, $user) ."\n";
       }
@@ -415,7 +437,8 @@ function _notify_send() {
       // Prepend node e-mail header as long as user could access at least one node.
       if ($node_count > 0) {
         $node_body = $separator ."\n"
-          . t('Recent content - !count', array('!count' => format_plural(count($nodes), '1 new post', '!count new posts'))) ."\n"
+       // . t('Recent content - !count', array('!count' => format_plural(count($nodes), '1 new post', '!count new posts'))) ."\n"
+          . t('Recent content - !count', array('!count' => format_plural(count($nodes), '1 new post', count($nodes) . ' new posts'))) ."\n"
           . $separator ."\n\n". $node_body;
       }
     }
@@ -438,7 +461,8 @@ function _notify_send() {
         if ($comment_body) {
           $comment_body .= $mini_separator ."\n\n";
         }
-        $comment_body .= t('!count attached to !type posted by !author: !title', array('!count' => format_plural(count($comment), '1 new comment', '!count new comments'), '!title' => $nodes[$nid]->title, '!type' => node_get_types('name', $nodes[$nid]), '!author' => $nodes[$nid]->name ? $nodes[$nid]->name : variable_get('anonymous', 'Anonymous'))) ."\n";
+//      $comment_body .= t('!count attached to !type posted by !author: !title', array('!count' => format_plural(count($comment), '1 new comment', '!count new comments'), '!title' => $nodes[$nid]->title, '!type' => node_get_types('name', $nodes[$nid]), '!author' => $nodes[$nid]->name ? $nodes[$nid]->name : variable_get('anonymous', 'Anonymous'))) ."\n";
+        $comment_body .= t('!count attached to !type posted by !author: !title', array('!count' => format_plural(count($comment), '1 new comment', count($total_comment_count) . ' new comments'), '!title' => $nodes[$nid]->title, '!type' => node_get_types('name', $nodes[$nid]), '!author' => $nodes[$nid]->name ? $nodes[$nid]->name : variable_get('anonymous', 'Anonymous'))) ."\n";

         $comment_count = 0;
         foreach ($comment as $c) {
@@ -450,7 +474,9 @@ function _notify_send() {

       if ($total_comment_count > 0) {
         $comment_body = $separator ."\n"
-          . t('Recent comments - !count', array('!count' => format_plural($total_comment_count, '1 new comment', '!count new comments'))) ."\n"
+        //. t('Recent comments - !count', array('!count' => format_plural($total_comment_count, '1 new comment', '!count new comments'))) ."\n"
+          . t('Recent comments - !count', array('!count' => format_plural($total_comment_count, '1 new comment', count($total_comment_count) . ' new comments'))) ."\n"
+
           . $separator ."\n\n". $comment_body;
       }
     }
