diff options
author | uckelman <uckelman@nomic.net> | 2010-04-13 21:38:33 +0000 |
---|---|---|
committer | uckelman <uckelman@nomic.net> | 2010-04-13 21:38:33 +0000 |
commit | 43506cef16623cf3c31ce5b4e0501f0e2d7b9864 (patch) | |
tree | 37dae55febfd9ec0892b980ff3ad44dd0d575221 /src | |
parent | 3f22dc639d43d3beda597bb8c41f034da9a1cfab (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/F2M.php | 26 |
1 files changed, 20 insertions, 6 deletions
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 @@ <?php try { - send_to_lists($user, $data, $post_data); + send_to_lists($user, $mode, $data, $post_data); } catch (Exception $e) { print "<p>$e</p>\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 '<p>'; var_dump($data); var_dump($post_data); print '</p>'; +*/ -/* # 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; } -*/ } ?> |