Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2019-10-10 14:36:35 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-01-08 16:01:06 +0300
commit150716df3480175ac223f59f9349eba8cedf6524 (patch)
tree4151035d6b00aba594799fbb4c1a4b5c935c206d /lib/Controller/MessagesController.php
parentb57fa26fc1401cf3afc4289e35c6ed5d0cc863b4 (diff)
Use KItinerary to extract information from emails and attachments
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/Controller/MessagesController.php')
-rwxr-xr-xlib/Controller/MessagesController.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/Controller/MessagesController.php b/lib/Controller/MessagesController.php
index d4ca2c4a6..22b5d7b03 100755
--- a/lib/Controller/MessagesController.php
+++ b/lib/Controller/MessagesController.php
@@ -31,7 +31,6 @@ declare(strict_types=1);
namespace OCA\Mail\Controller;
use Exception;
-use OCA\Mail\Account;
use OCA\Mail\Contracts\IMailManager;
use OCA\Mail\Contracts\IMailSearch;
use OCA\Mail\Exception\ServiceException;
@@ -40,6 +39,7 @@ use OCA\Mail\Http\HtmlResponse;
use OCA\Mail\Model\IMAPMessage;
use OCA\Mail\Service\AccountService;
use OCA\Mail\Service\IMailBox;
+use OCA\Mail\Service\ItineraryService;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Http;
@@ -47,7 +47,6 @@ use OCP\AppFramework\Http\ContentSecurityPolicy;
use OCP\AppFramework\Http\JSONResponse;
use OCP\AppFramework\Http\Response;
use OCP\AppFramework\Http\TemplateResponse;
-use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Files\Folder;
use OCP\Files\IMimeTypeDetector;
use OCP\IL10N;
@@ -67,6 +66,9 @@ class MessagesController extends Controller {
/** @var IMailSearch */
private $mailSearch;
+ /** @var ItineraryService */
+ private $itineraryService;
+
/** @var string */
private $currentUserId;
@@ -101,6 +103,7 @@ class MessagesController extends Controller {
AccountService $accountService,
IMailManager $mailManager,
IMailSearch $mailSearch,
+ ItineraryService $itineraryService,
string $UserId,
$userFolder,
ILogger $logger,
@@ -112,6 +115,7 @@ class MessagesController extends Controller {
$this->accountService = $accountService;
$this->mailManager = $mailManager;
$this->mailSearch = $mailSearch;
+ $this->itineraryService = $itineraryService;
$this->currentUserId = $UserId;
$this->userFolder = $userFolder;
$this->logger = $logger;
@@ -180,6 +184,11 @@ class MessagesController extends Controller {
base64_decode($folderId),
$id
);
+ $json['itineraries'] = $this->itineraryService->extract(
+ $account,
+ base64_decode($folderId),
+ $id
+ );
$json['attachments'] = array_map(function ($a) use ($accountId, $folderId, $id) {
return $this->enrichDownloadUrl($accountId, $folderId, $id, $a);
}, $json['attachments']);