-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! fix(imap): persist vanished messages immediately on EXAMINE co…
…mmands
- Loading branch information
Showing
9 changed files
with
224 additions
and
485 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
namespace OCA\Mail\Cache; | ||
|
||
class CachedMailbox { | ||
/** @var int[]|null */ | ||
private ?array $uids = null; | ||
|
||
private ?int $uidValidity = null; | ||
private ?int $highestModSeq = null; | ||
|
||
/** | ||
* @return int[]|null | ||
*/ | ||
public function getUids(): ?array { | ||
return $this->uids; | ||
} | ||
|
||
/** | ||
* @param int[]|null $uids | ||
*/ | ||
public function setUids(?array $uids): void { | ||
$this->uids = $uids; | ||
} | ||
|
||
public function getUidValidity(): ?int { | ||
return $this->uidValidity; | ||
} | ||
|
||
public function setUidValidity(?int $uidvalid): void { | ||
$this->uidValidity = $uidvalid; | ||
} | ||
|
||
public function getHighestModSeq(): ?int { | ||
return $this->highestModSeq; | ||
} | ||
|
||
public function setHighestModSeq(?int $highestModSeq): void { | ||
$this->highestModSeq = $highestModSeq; | ||
} | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
namespace OCA\Mail\Cache; | ||
|
||
class HordeSyncToken { | ||
public function __construct( | ||
private ?int $nextUid, | ||
private ?int $uidValidity, | ||
private ?int $highestModSeq, | ||
) { | ||
} | ||
|
||
public function getNextUid(): ?int { | ||
return $this->nextUid; | ||
} | ||
|
||
public function getUidValidity(): ?int { | ||
return $this->uidValidity; | ||
} | ||
|
||
public function getHighestModSeq(): ?int { | ||
return $this->highestModSeq; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
namespace OCA\Mail\Cache; | ||
|
||
class HordeSyncTokenParser { | ||
public function parseSyncToken(string $token): HordeSyncToken { | ||
$decodedToken = base64_decode($token, true); | ||
$parts = explode(',', $decodedToken); | ||
|
||
$nextUid = null; | ||
$uidValidity = null; | ||
$highestModSeq = null; | ||
foreach ($parts as $part) { | ||
if (str_starts_with($part, 'U')) { | ||
$nextUid = (int)substr($part, 1); | ||
} | ||
|
||
if (str_starts_with($part, 'V')) { | ||
$uidValidity = (int)substr($part, 1); | ||
} | ||
|
||
if (str_starts_with($part, 'H')) { | ||
$highestModSeq = (int)substr($part, 1); | ||
} | ||
} | ||
|
||
return new HordeSyncToken($nextUid, $uidValidity, $highestModSeq); | ||
} | ||
} |
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
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
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
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