Skip to content

Commit 1b5218d

Browse files
committed
Add ability to set query fetch modifiers
1 parent 8fd826d commit 1b5218d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Connection/ConnectionInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public function flags(int|array $ids): ResponseCollection;
181181
*
182182
* @see https://datatracker.ietf.org/doc/html/rfc9051#name-fetch-command
183183
*/
184-
public function fetch(array|string $items, array|int $from, mixed $to = null, ImapFetchIdentifier $identifier = ImapFetchIdentifier::Uid): ResponseCollection;
184+
public function fetch(array|string $items, array|int $from, mixed $to = null, ImapFetchIdentifier $identifier = ImapFetchIdentifier::Uid, array|string $modifiers = []): ResponseCollection;
185185

186186
/**
187187
* Send a "RFC822.SIZE" command.

src/Connection/ImapConnection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,13 +602,14 @@ protected function write(string $data): void
602602
/**
603603
* Fetch one or more items for one or more messages.
604604
*/
605-
public function fetch(array|string $items, array|int $from, mixed $to = null, ImapFetchIdentifier $identifier = ImapFetchIdentifier::Uid): ResponseCollection
605+
public function fetch(array|string $items, array|int $from, mixed $to = null, ImapFetchIdentifier $identifier = ImapFetchIdentifier::Uid, array|string $modifiers = []): ResponseCollection
606606
{
607607
$prefix = ($identifier === ImapFetchIdentifier::Uid) ? 'UID' : '';
608608

609609
$this->send(trim($prefix.' FETCH'), [
610610
Str::set($from, $to),
611611
Str::list((array) $items),
612+
Str::list((array) $modifiers),
612613
], $tag);
613614

614615
$this->assertTaggedResponse($tag);

0 commit comments

Comments
 (0)