Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mnapoli committed Oct 21, 2024
1 parent 442b789 commit dcc181f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion console
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ $cli->command('reparse', function (EmailRepository $repository, EmailContentPars
} catch (NotFound) {
continue;
}
$parsedDocument = (new MailMimeParser)->parse($email->getSource());
$parsedDocument = (new MailMimeParser)->parse($email->getSource(), false);
$content = $parser->parse((string) $parsedDocument->getTextContent());
$repository->updateContent($email->getId(), $content);
$output->writeln("<info>Updated email {$number}</info>");
Expand Down
8 changes: 4 additions & 4 deletions src/EmailSynchronizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
use Rvdv\Nntp\Exception\UnknownHandlerException;
use Throwable;
use ZBateson\MailMimeParser\Header\DateHeader;
use ZBateson\MailMimeParser\IMessage;
use ZBateson\MailMimeParser\MailMimeParser;
use ZBateson\MailMimeParser\Message;

class EmailSynchronizer
{
Expand Down Expand Up @@ -108,9 +108,9 @@ public function synchronizeEmail(int $number, string $source): void
}

$mailParser = new MailMimeParser;
$parsedDocument = $mailParser->parse($source);
$parsedDocument = $mailParser->parse($source, false);

$subject = $this->subjectParser->sanitize($parsedDocument->getHeaderValue('subject'));
$subject = $this->subjectParser->sanitize((string) $parsedDocument->getHeaderValue('subject'));
$content = $this->contentParser->parse((string) $parsedDocument->getTextContent());

// We don't use the special AddressHeader class because it doesn't seem to parse the
Expand Down Expand Up @@ -200,7 +200,7 @@ public function synchronizeEmail(int $number, string $source): void
});
}

private function parseDateTime(Message $parsedDocument): ?DateTimeInterface
private function parseDateTime(IMessage $parsedDocument): ?DateTimeInterface
{
$dateHeader = $parsedDocument->getHeader('date');

Expand Down

0 comments on commit dcc181f

Please sign in to comment.