-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4cedff8
commit e680cdb
Showing
8 changed files
with
80 additions
and
43 deletions.
There are no files selected for viewing
57 changes: 30 additions & 27 deletions
57
src/ActiveCollab/EmailReplyExtractor/Extractor/AppleMailExtractor.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,36 @@ | ||
<?php | ||
namespace ActiveCollab\EmailReplyExtractor\Extractor; | ||
|
||
/** | ||
* @package ActiveCollab\EmailReplyExtractor\Extractor | ||
*/ | ||
final class AppleMailExtractor extends Extractor | ||
{ | ||
// /** | ||
// * Extract Reply from Apple MAil mail | ||
// */ | ||
// protected function processLines() | ||
// { | ||
// $splitters = $this->getOriginalMessageSplitters(); | ||
// | ||
// if (!empty($splitters)) { | ||
// $this->stripOriginalMessage($splitters); | ||
// } | ||
// | ||
// $this->body = implode("\n", $this->body); | ||
// if (preg_match('/(.*)(On)(.*) at (.*) wrote\:(.*)/mis', $this->body, $matches, PREG_OFFSET_CAPTURE)) { | ||
// $match_index = $matches[2][1]; | ||
// $this->body = trim(mb_substr($this->body, 0, $match_index)); | ||
// $this->body = explode("\n", $this->body); | ||
// } | ||
// | ||
// $unwanted_text_patterns = $this->getUnwantedTextPatterns(); | ||
// | ||
// if (!empty($unwanted_text_patterns)) { | ||
// self::stripUnwantedText($unwanted_text_patterns); | ||
// } | ||
// | ||
// self::stripSignature(); | ||
// self::convertPlainTextQuotesToBlockquotes(); | ||
// } | ||
/** | ||
* Extract Reply from Apple MAil mail | ||
*/ | ||
protected function processLines() | ||
{ | ||
$splitters = $this->getOriginalMessageSplitters(); | ||
|
||
if (!empty($splitters)) { | ||
$this->stripOriginalMessage($splitters); | ||
} | ||
|
||
$this->body = implode("\n", $this->body); | ||
if (preg_match('/(.*)(On)(.*) at (.*) wrote\:(.*)/mis', $this->body, $matches, PREG_OFFSET_CAPTURE)) { | ||
$match_index = $matches[2][1]; | ||
$this->body = trim(mb_substr($this->body, 0, $match_index)); | ||
} | ||
$this->body = explode("\n", $this->body); | ||
|
||
$unwanted_text_patterns = $this->getUnwantedTextPatterns(); | ||
|
||
if (!empty($unwanted_text_patterns)) { | ||
$this->stripUnwantedText($unwanted_text_patterns); | ||
} | ||
|
||
$this->stripSignature(); | ||
$this->convertPlainTextQuotesToBlockquotes(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
src/ActiveCollab/EmailReplyExtractor/Extractor/GoogleMailExtractor.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
src/ActiveCollab/EmailReplyExtractor/Extractor/HotmailExtractor.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
<?php | ||
namespace ActiveCollab\EmailReplyExtractor\Extractor; | ||
|
||
/** | ||
* @package ActiveCollab\EmailReplyExtractor\Extractor | ||
*/ | ||
final class HotmailExtractor extends Extractor | ||
{ | ||
|
||
} |
4 changes: 3 additions & 1 deletion
4
src/ActiveCollab/EmailReplyExtractor/Extractor/HushmailExtractor.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
<?php | ||
namespace ActiveCollab\EmailReplyExtractor\Extractor; | ||
|
||
/** | ||
* @package ActiveCollab\EmailReplyExtractor\Extractor | ||
*/ | ||
final class HushmailExtractor extends Extractor | ||
{ | ||
|
||
} |
4 changes: 3 additions & 1 deletion
4
src/ActiveCollab/EmailReplyExtractor/Extractor/OutlookExtractor.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
<?php | ||
namespace ActiveCollab\EmailReplyExtractor\Extractor; | ||
|
||
/** | ||
* @package ActiveCollab\EmailReplyExtractor\Extractor | ||
*/ | ||
final class OutlookExtractor extends Extractor | ||
{ | ||
|
||
} |
15 changes: 14 additions & 1 deletion
15
src/ActiveCollab/EmailReplyExtractor/Extractor/YahooExtractor.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,20 @@ | ||
<?php | ||
namespace ActiveCollab\EmailReplyExtractor\Extractor; | ||
|
||
/** | ||
* @package ActiveCollab\EmailReplyExtractor\Extractor | ||
*/ | ||
final class YahooExtractor extends Extractor | ||
{ | ||
|
||
/** | ||
* Return splitters | ||
* | ||
* @return array | ||
*/ | ||
protected function getOriginalMessageSplitters() | ||
{ | ||
return array_merge(parent::getOriginalMessageSplitters(), [ | ||
'/On(.*?)wrote\:(.*?)/is' | ||
]); | ||
} | ||
} |
4 changes: 3 additions & 1 deletion
4
src/ActiveCollab/EmailReplyExtractor/Extractor/iOSExtractor.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
<?php | ||
namespace ActiveCollab\EmailReplyExtractor\Extractor; | ||
|
||
/** | ||
* @package ActiveCollab\EmailReplyExtractor\Extractor | ||
*/ | ||
final class iOSExtractor extends Extractor | ||
{ | ||
|
||
} |