summaryrefslogtreecommitdiff
path: root/src/M2F.php
diff options
context:
space:
mode:
authoruckelman <uckelman@nomic.net>2010-04-30 21:38:50 +0000
committeruckelman <uckelman@nomic.net>2010-04-30 21:38:50 +0000
commite3f6bc31ff1e108de52faae926d96a73df32557e (patch)
treea2cb04492d116aeb686355f3451249a624135de6 /src/M2F.php
parent340fc57f4573f7b623edad830244f1f5096ab8ab (diff)
mv M2F.php list_post_receive.php.
git-svn-id: https://vassalengine.svn.sourceforge.net/svnroot/vassalengine/site-src/trunk@6797 67b53d14-2c14-4ace-a08f-0dab2b34000c
Diffstat (limited to 'src/M2F.php')
-rw-r--r--src/M2F.php78
1 files changed, 0 insertions, 78 deletions
diff --git a/src/M2F.php b/src/M2F.php
deleted file mode 100644
index a8d2749..0000000
--- a/src/M2F.php
+++ /dev/null
@@ -1,78 +0,0 @@
-<?php
-
-try {
- require_once(__DIR__ . '/Bridge.php');
- require_once(__DIR__ . '/MailmanLib.php');
- require_once(__DIR__ . '/MailmanMessage.php');
- require_once(__DIR__ . '/PhpBB3.php');
-
- # Read the message from STDIN
- $url = 'php://stdin';
-
- $input = read_raw_message($url);
- $msg = new MailmanMessage($input);
-
- $messageId = $msg->getMessageId();
- $inReplyTo = $msg->getInReplyTo();
- $rererences = $msg->getReferences();
-
- $bridge = new Bridge();
- $seen = !$bridge->registerMessage(null, $messageId, $inReplyTo);
-
- try {
- if ($seen) {
- # This message has already been processed, bail out
- print 'Message id already seen, skipping: ' . $messageId . "\n";
- exit;
- }
-
- $phpbb = new PhpBB3();
-
- $forumId = $topicId = -1;
- $postType = null;
-
- if ($inReplyTo) {
- # Possibly a reply to an existing topic
- $parentId = $bridge->getPostId($inReplyTo);
- if ($parentId === false) {
- throw new Exception('unrecognized reply-to: ' . $inReplyTo);
- }
-
- $ids = $phpbb->getTopicAndForumIds($parentId);
- if ($ids === false) {
- throw new Exception('unrecognized parent id: ' . $parentId);
- }
-
- # Found the parent's forum and topic, post to those
- $forumId = $ids['forum_id'];
- $topicId = $ids['topic_id'];
- $postType = 'reply';
- }
- else {
- # A message starting a new topic, post to default forum for its source
- $forumId = $bridge->getDefaultForumId($msg->getSource());
- if ($forumId === false) {
- throw new Exception('unrecognized source: ' . $msg->getSource());
- }
-
- $postType = 'post';
- }
-
-# FIXME: the subject and body may be charset encoded---need to decode these
-# before posting!
-
- # Post the message to the forum
- $postId = $phpbb->postMessage($postType, $forumId, $topicId, $msg);
- $bridge->setPostId($messageId, $postId);
- }
- catch (Exception $e) {
- # Bridging failed, unregister message.
- $bridge->unregisterMessage($messageId);
- throw $e;
- }
-}
-catch (Exception $e) {
- print "$e\n";
-}
-
-?>