Commit 9bc8da14 authored by Dane Powell's avatar Dane Powell
Browse files

Issue #1188584 by arvinsingla, Dane Powell: Fixed reply text not being stripped from message body.

parent afd51c2f
Loading
Loading
Loading
Loading
+1 −0
Changes for CHANGELOG.txt: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
Mail Comment 7.x-2.x, 2011-08-30
--------------------------------
#1188584 by arvinsingla, Dane Powell: Fixed reply text not being stripped from message body.
Removed hook_mailcomment_alter() - the same functionality can be achieved with existing Feeds hooks.
Updated for compatibility with Mailhandler 7.x-2.0-beta2
#1248182 by Dane Powell: Fixed WSOD on configuration page (again)
+4 −4
Changes for mailcomment.module: 4 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -513,11 +513,11 @@ function mailcomment_feeds_after_parse(FeedsImporter $importer, FeedsSource $sou
  // Now trim out the rest of the message if separator text exists
  // @ TODO May fail for html mails
  if ($marker = variable_get('mailcomment_reply_text', t('((( Reply ABOVE this LINE to POST a COMMENT )))'))) {
    // Now the dirty part. May need some more clean up for line endings, spare html, etc...
    $pos = strpos($node->body, $marker);
    foreach ($source->batch->items as &$message) {
      $pos = strpos($message['origbody'], $marker);
      if ($pos !== FALSE) {
      // Mailhandler brings this in as a full node with teaser/body but we need to change context to comment
      $node->body = drupal_substr($node->body, 0, $pos);
        $message['origbody'] = drupal_substr($message['origbody'], 0, $pos);
      }
    }
  }
}