Skip to content

Commit bc259c4

Browse files
committed
fixup! Add imip processing
1 parent 005f30d commit bc259c4

4 files changed

Lines changed: 4 additions & 27 deletions

File tree

lib/Db/MessageMapper.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,6 @@ public function updateBulk(Account $account, bool $permflagsEnabled, Message ...
379379
->set('flag_mdnsent', $query->createParameter('flag_mdnsent'))
380380
->set('flag_important', $query->createParameter('flag_important'))
381381
->set('updated_at', $query->createNamedParameter($this->timeFactory->getTime()))
382-
// ->set('imip_message', $query->createParameter('imip_message'))
383382
->where($query->expr()->andX(
384383
$query->expr()->eq('uid', $query->createParameter('uid')),
385384
$query->expr()->eq('mailbox_id', $query->createParameter('mailbox_id'))
@@ -407,7 +406,6 @@ public function updateBulk(Account $account, bool $permflagsEnabled, Message ...
407406
$query->setParameter('flag_notjunk', $message->getFlagNotjunk(), IQueryBuilder::PARAM_BOOL);
408407
$query->setParameter('flag_mdnsent', $message->getFlagMdnsent(), IQueryBuilder::PARAM_BOOL);
409408
$query->setParameter('flag_important', $message->getFlagImportant(), IQueryBuilder::PARAM_BOOL);
410-
// $query->setParameter('imip_message', $message->isImipMessage(), IQueryBuilder::PARAM_BOOL);
411409
$query->execute();
412410
$perf->step('Updated message ' . $message->getId());
413411
}
@@ -1291,7 +1289,7 @@ public function findIMipMessagesAscending(): array {
12911289
$qb->expr()->eq('imip_message', $qb->createNamedParameter(true, IQueryBuilder::PARAM_BOOL), IQueryBuilder::PARAM_BOOL),
12921290
$qb->expr()->eq('imip_processed', $qb->createNamedParameter(false, IQueryBuilder::PARAM_BOOL), IQueryBuilder::PARAM_BOOL),
12931291
$qb->expr()->eq('imip_error', $qb->createNamedParameter(false, IQueryBuilder::PARAM_BOOL), IQueryBuilder::PARAM_BOOL),
1294-
$qb->expr()->eq('flag_junked', $qb->createNamedParameter(false, IQueryBuilder::PARAM_BOOL), IQueryBuilder::PARAM_BOOL),
1292+
$qb->expr()->eq('flag_junk', $qb->createNamedParameter(false, IQueryBuilder::PARAM_BOOL), IQueryBuilder::PARAM_BOOL),
12951293
$qb->expr()->gt('sent_at', $qb->createNamedParameter($time, IQueryBuilder::PARAM_INT)),
12961294
)->orderBy('sent_at', 'ASC'); // make sure we don't process newer messages first
12971295

lib/IMAP/MessageMapper.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,11 +681,13 @@ public function getBodyStructureData(Horde_Imap_Client_Socket $client,
681681
$isImipMessage = false;
682682

683683
$structure = $fetchData->getStructure();
684+
/** @var Horde_Mime_Part $part */
684685
foreach ($structure->getParts() as $part) {
685686
if ($part->isAttachment()) {
686687
$hasAttachments = true;
687688
}
688689
$bodyParts = $part->getParts();
690+
/** @var Horde_Mime_Part $bodyPart */
689691
foreach ($bodyParts as $bodyPart) {
690692
$contentParameters = $bodyPart->getAllContentTypeParameters();
691693
if ($bodyPart->getType() === 'text/calendar' && isset($contentParameters['method'])) {

lib/Service/IMipService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function process(): void {
128128
try {
129129
$imapMessages = $this->mailManager->getImapMessagesForScheduleProcessing($account, $mailbox, array_map(function ($message) {
130130
return $message->getUid();
131-
}, $filteredMessages), true);
131+
}, $filteredMessages));
132132
} catch (ServiceException $e) {
133133
$this->logger->error('Could not get IMAP messages form IMAP server', ['exception' => $e]);
134134
continue;

tests/Unit/Service/PreprocessingServiceTest.php

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,4 @@
11
<?php
2-
/*
3-
* *
4-
* * {$app} App
5-
* *
6-
* * @copyright 2022 Anna Larch <anna.larch@gmx.net>
7-
* *
8-
* * @author Anna Larch <anna.larch@gmx.net>
9-
* *
10-
* * This library is free software; you can redistribute it and/or
11-
* * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
12-
* * License as published by the Free Software Foundation; either
13-
* * version 3 of the License, or any later version.
14-
* *
15-
* * This library is distributed in the hope that it will be useful,
16-
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
17-
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18-
* * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
19-
* *
20-
* * You should have received a copy of the GNU Affero General Public
21-
* * License along with this library. If not, see <http://www.gnu.org/licenses/>.
22-
* *
23-
*
24-
*/
252

263
declare(strict_types=1);
274

0 commit comments

Comments
 (0)