original_string: protected function get_message_headers($course, $forum, $discussion, $post, $a, $message) {
          $cleanforumname = str_replace('"', "'", strip_tags(format_string($forum->name)));
          $viewurl = new \moodle_url('/mod/forum/view.php', ['f' => $forum->id]);
  
          $headers = [
              // Headers to make emails easier to track.
              'List-Id: "' . $cleanforumname . '" ' . generate_email_messageid('moodleforum' . $forum->id),
              'List-Help: ' . $viewurl->out(),
              'Message-ID: ' . forum_get_email_message_id($post->id, $this->recipient->id),
              'X-Course-Id: ' . $course->id,
              'X-Course-Name: '. format_string($course->fullname, true),
  
              // Headers to help prevent auto-responders.
              'Precedence: Bulk',
              'X-Auto-Response-Suppress: All',
              'Auto-Submitted: auto-generated',
              'List-Unsubscribe: <' . $message->get_unsubscribediscussionlink() . '>',
          ];
  
          $rootid = forum_get_email_message_id($discussion->firstpost, $this->recipient->id);
  
          if ($post->parent) {
              // This post is a reply, so add reply header (RFC 2822).
              $parentid = forum_get_email_message_id($post->parent, $this->recipient->id);
              $headers[] = "In-Reply-To: $parentid";
  
              // If the post is deeply nested we also reference the parent message id and
              // the root message id (if different) to aid threading when parts of the email
              // conversation have been deleted (RFC1036).
              if ($post->parent != $discussion->firstpost) {
                  $headers[] = "References: $rootid $parentid";
              } else {
                  $headers[] = "References: $parentid";
              }
          }
  
          // MS Outlook / Office uses poorly documented and non standard headers, including
          // Thread-Topic which overrides the Subject and shouldn't contain Re: or Fwd: etc.
          $aclone = (object) (array) $a;
          $aclone->subject = $discussion->name;
          $threadtopic = html_to_text(get_string('postmailsubject', 'forum', $aclone), 0);
          $headers[] = "Thread-Topic: $threadtopic";
          $headers[] = "Thread-Index: " . substr($rootid, 1, 28);
  
          return $headers;
      }
code: protected function get_message_headers($course, $forum, $discussion, $post, $a, $message) {
          $cleanforumname = str_replace('"', "'", strip_tags(format_string($forum->name)));
          $viewurl = new \moodle_url('/mod/forum/view.php', ['f' => $forum->id]);
  
          $headers = [
              // Headers to make emails easier to track.
              'List-Id: "' . $cleanforumname . '" ' . generate_email_messageid('moodleforum' . $forum->id),
              'List-Help: ' . $viewurl->out(),
              'Message-ID: ' . forum_get_email_message_id($post->id, $this->recipient->id),
              'X-Course-Id: ' . $course->id,
              'X-Course-Name: '. format_string($course->fullname, true),
  
              // Headers to help prevent auto-responders.
              'Precedence: Bulk',
              'X-Auto-Response-Suppress: All',
              'Auto-Submitted: auto-generated',
              'List-Unsubscribe: <' . $message->get_unsubscribediscussionlink() . '>',
          ];
  
          $rootid = forum_get_email_message_id($discussion->firstpost, $this->recipient->id);
  
          if ($post->parent) {
              // This post is a reply, so add reply header (RFC 2822).
              $parentid = forum_get_email_message_id($post->parent, $this->recipient->id);
              $headers[] = "In-Reply-To: $parentid";
  
              // If the post is deeply nested we also reference the parent message id and
              // the root message id (if different) to aid threading when parts of the email
              // conversation have been deleted (RFC1036).
              if ($post->parent != $discussion->firstpost) {
                  $headers[] = "References: $rootid $parentid";
              } else {
                  $headers[] = "References: $parentid";
              }
          }
  
          // MS Outlook / Office uses poorly documented and non standard headers, including
          // Thread-Topic which overrides the Subject and shouldn't contain Re: or Fwd: etc.
          $aclone = (object) (array) $a;
          $aclone->subject = $discussion->name;
          $threadtopic = html_to_text(get_string('postmailsubject', 'forum', $aclone), 0);
          $headers[] = "Thread-Topic: $threadtopic";
          $headers[] = "Thread-Index: " . substr($rootid, 1, 28);
  
          return $headers;
      }
code_tokens: protected function get_message_headers ( $ course , $ forum , $ discussion , $ post , $ a , $ message ) { $ cleanforumname = str_replace ( '"' , "'" , strip_tags ( format_string ( $ forum -> name ) ) ) ; $ viewurl = new \ moodle_url ( '/mod/forum/view.php' , [ 'f' => $ forum -> id ] ) ; $ headers = [ // Headers to make emails easier to track. 'List-Id: "' . $ cleanforumname . '" ' . generate_email_messageid ( 'moodleforum' . $ forum -> id ) , 'List-Help: ' . $ viewurl -> out ( ) , 'Message-ID: ' . forum_get_email_message_id ( $ post -> id , $ this -> recipient -> id ) , 'X-Course-Id: ' . $ course -> id , 'X-Course-Name: ' . format_string ( $ course -> fullname , true ) , // Headers to help prevent auto-responders. 'Precedence: Bulk' , 'X-Auto-Response-Suppress: All' , 'Auto-Submitted: auto-generated' , 'List-Unsubscribe: <' . $ message -> get_unsubscribediscussionlink ( ) . '>' , ] ; $ rootid = forum_get_email_message_id ( $ discussion -> firstpost , $ this -> recipient -> id ) ; if ( $ post -> parent ) { // This post is a reply, so add reply header (RFC 2822). $ parentid = forum_get_email_message_id ( $ post -> parent , $ this -> recipient -> id ) ; $ headers [ ] = "In-Reply-To: $parentid" ; // If the post is deeply nested we also reference the parent message id and // the root message id (if different) to aid threading when parts of the email // conversation have been deleted (RFC1036). if ( $ post -> parent != $ discussion -> firstpost ) { $ headers [ ] = "References: $rootid $parentid" ; } else { $ headers [ ] = "References: $parentid" ; } } // MS Outlook / Office uses poorly documented and non standard headers, including // Thread-Topic which overrides the Subject and shouldn't contain Re: or Fwd: etc. $ aclone = ( object ) ( array ) $ a ; $ aclone -> subject = $ discussion -> name ; $ threadtopic = html_to_text ( get_string ( 'postmailsubject' , 'forum' , $ aclone ) , 0 ) ; $ headers [ ] = "Thread-Topic: $threadtopic" ; $ headers [ ] = "Thread-Index: " . substr ( $ rootid , 1 , 28 ) ; return $ headers ; }
docstring: Get the list of message headers.
  
  @param   \stdClass   $course
  @param   \stdClass   $forum
  @param   \stdClass   $discussion
  @param   \stdClass   $post
  @param   \stdClass   $a The list of strings for this  post
  @param   \core\message\message $message The message to be sent
  @return  \stdClass
docstring_tokens: Get the list of message headers .