From 43506cef16623cf3c31ce5b4e0501f0e2d7b9864 Mon Sep 17 00:00:00 2001 From: uckelman Date: Tue, 13 Apr 2010 21:38:33 +0000 Subject: Added In-Reply-To and References headers. git-svn-id: https://vassalengine.svn.sourceforge.net/svnroot/vassalengine/site-src/trunk@6706 67b53d14-2c14-4ace-a08f-0dab2b34000c --- src/F2M.php | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'src/F2M.php') diff --git a/src/F2M.php b/src/F2M.php index 086a4cd..ab19a9d 100644 --- a/src/F2M.php +++ b/src/F2M.php @@ -1,13 +1,13 @@ $e

\n"; } -function send_to_lists($user, $data, $post_data) { +function send_to_lists($user, $mode, $data, $post_data) { require_once('Mail.php'); @@ -44,22 +44,37 @@ function send_to_lists($user, $data, $post_data) { $date = date(DATE_RFC2822, $time); $messageId = build_message_id($time, $postId, $_SERVER['SERVER_NAME']); - + $inReplyTo = null; $references = null; + + if ($mode == 'reply') { + $firstId = $phpbb->getFirstPostId($topicId); + if ($firstId === false) { + throw new Exception('topic has no first post: ' . $topicId); + } + + $firstMessageId = $bridge->getMessageId($firstId); + if ($firstMessageId === null) { + throw new Exception('unrecognized post id: ' . $firstId); + } + +# FIXME: try to build better References by matching, maybe? + $inReplyTo = $references = $firstMessageId; + } $forumURL = 'http://' . $_SERVER['SERVER_NAME'] . dirname($_SERVER['SCRIPT_NAME']); $body = $data['message']; - +/* print '

'; var_dump($data); var_dump($post_data); print '

'; +*/ -/* # Assemble the message headers $headers = array( 'To' => $to, @@ -98,7 +113,6 @@ function send_to_lists($user, $data, $post_data) { $bridge->unregisterMessage($messageId); throw $e; } -*/ } ?> -- cgit v1.2.3