diff options
author | uckelman <uckelman@nomic.net> | 2010-03-20 15:33:53 +0000 |
---|---|---|
committer | uckelman <uckelman@nomic.net> | 2010-03-20 15:33:53 +0000 |
commit | 78fe98c7f6f2097d466b6351de0c259cf2db57a9 (patch) | |
tree | 4535cc5492b8e4b78813e226124b47adfba9e460 /src | |
parent | 946b326a1b3aa6f1f01161c4c385a3efb1d24d0a (diff) |
Refactored to make EmailMessage abstract.
git-svn-id: https://vassalengine.svn.sourceforge.net/svnroot/vassalengine/site-src/trunk@6621 67b53d14-2c14-4ace-a08f-0dab2b34000c
Diffstat (limited to 'src')
-rw-r--r-- | src/MailmanMessage.php | 17 | ||||
-rw-r--r-- | src/MessageTest.php (renamed from src/EmailMessage.php) | 12 |
2 files changed, 21 insertions, 8 deletions
diff --git a/src/MailmanMessage.php b/src/MailmanMessage.php new file mode 100644 index 0000000..c284a8e --- /dev/null +++ b/src/MailmanMessage.php @@ -0,0 +1,17 @@ +<?php + +require_once(__DIR__ . '/EmailMessage.php'); + +class MailmanMessage extends EmailMessage { + public function __construct($input) { + parent::__construct($input); + } + + public function getSource() { + return self::parse_addr( + substr_replace($this->msg->headers['list-post'], '', 1, 7) + ); + } +} + +?> diff --git a/src/EmailMessage.php b/src/MessageTest.php index d6ff762..ce04cf6 100644 --- a/src/EmailMessage.php +++ b/src/MessageTest.php @@ -5,26 +5,22 @@ require_once('Mail/RFC822.php'); require_once('Message.php'); -class EMailMessage implements Message { +abstract class EmailMessage implements Message { protected $msg; public function __construct($input) { - $this->msg = EMailMessage::decode_raw_message($input); + $this->msg = self::decode_raw_message($input); } - public function getSource() { -# FIXME: fill in! - return null; - } + public abstract function getSource(); public function getPostId() { -# FIXME: get from message-id to post-id database return null; } public function getFrom() { - return EMailMessage::parse_addr($this->msg->headers['from']); + return self::parse_addr($this->msg->headers['from']); } public function getSubject() { |