Permalink
Browse files

forum MDL-22551 Don't put In-Reply-To and References headers on the f…

…irst post for a thread
  • Loading branch information...
1 parent 86254f7 commit 436f4e07579c7023e2436b4320c17bedd4feb088 @moodler moodler committed Sep 16, 2010
Showing with 4 additions and 2 deletions.
  1. +4 −2 mod/forum/lib.php
View
@@ -455,12 +455,14 @@ function forum_cron() {
'List-Id: "'.$cleanforumname.'" <moodleforum'.$forum->id.'@'.$hostname.'>',
'List-Help: '.$CFG->wwwroot.'/mod/forum/view.php?f='.$forum->id,
'Message-ID: <moodlepost'.$post->id.'@'.$hostname.'>',
- 'In-Reply-To: <moodlepost'.$post->parent.'@'.$hostname.'>',
- 'References: <moodlepost'.$post->parent.'@'.$hostname.'>',
'X-Course-Id: '.$course->id,
'X-Course-Name: '.format_string($course->fullname, true)
);
+ if ($post->parent) { // This post is a reply, so add headers for threading (see MDL-22551)
+ $userfrom->customheaders[] = 'In-Reply-To: <moodlepost'.$post->parent.'@'.$hostname.'>';
+ $userfrom->customheaders[] = 'References: <moodlepost'.$post->parent.'@'.$hostname.'>',
+ }
$postsubject = "$course->shortname: ".format_string($post->subject,true);
$posttext = forum_make_mail_text($course, $forum, $discussion, $post, $userfrom, $userto);

0 comments on commit 436f4e0

Please sign in to comment.