Commit 939e05bb authored by Dane Powell's avatar Dane Powell
Browse files

Issue #855312 by Dane Powell, Ian Ward: Pass full node to hook_mailhandler_post_save.

parent 85b623c1
Loading
Loading
Loading
Loading
+6 −4
Changes for mailhandler.module: 6 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -578,11 +578,11 @@ function mailhandler_node_process_message($header, $origbody, $mailbox, $mimepar

  if ($node) {
    if ($node->type == 'comment') {
      $nid = mailhandler_comment_submit($node, $header, $mailbox, $origbody);
      $saved = mailhandler_comment_submit($node, $header, $mailbox, $origbody);
      $type = 'comment';
    }
    else {
      $nid = mailhandler_node_submit($node, $header, $mailbox, $origbody);
      $saved = mailhandler_node_submit($node, $header, $mailbox, $origbody);
      $type = 'node';
    }
  }
@@ -591,8 +591,10 @@ function mailhandler_node_process_message($header, $origbody, $mailbox, $mimepar
  foreach (module_list() as $name) {
    if (module_hook($name, 'mailhandler_post_save')) {
      $function = $name .'_mailhandler_post_save';
      // Pass in the $nid (which could be a $cid, depending on $node->type)
      $function($nid, $type);
      // Pass in what's returned from saving the comment (cid) or node (object), the
      // object type, and the original node object (which is the same as $saved in
      // the case of saving a node).
      $function($saved, $type, $node);
    }
  }