Skip to content

Commit c6cd0c9

Browse files
committed
Allow passing in an identifier to determine if a UID exists
1 parent 523205d commit c6cd0c9

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/Connection/ConnectionInterface.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use DirectoryTree\ImapEngine\Collections\ResponseCollection;
66
use DirectoryTree\ImapEngine\Connection\Responses\TaggedResponse;
77
use DirectoryTree\ImapEngine\Connection\Responses\UntaggedResponse;
8+
use DirectoryTree\ImapEngine\Enums\ImapFetchIdentifier;
89
use Generator;
910

1011
interface ConnectionInterface
@@ -126,7 +127,7 @@ public function id(?array $ids = null): UntaggedResponse;
126127
*
127128
* @see https://datatracker.ietf.org/doc/html/rfc9051#name-uid-command
128129
*/
129-
public function uid(int|array $msgns): ResponseCollection;
130+
public function uid(int|array $ids, ImapFetchIdentifier $identifier): ResponseCollection;
130131

131132
/**
132133
* Send a "FETCH BODY[TEXT]" command.

src/Connection/ImapConnection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,9 @@ public function store(array|string $flags, array|int $from, ?int $to = null, ?st
379379
/**
380380
* {@inheritDoc}
381381
*/
382-
public function uid(int|array $msgns): ResponseCollection
382+
public function uid(int|array $ids, ImapFetchIdentifier $identifier): ResponseCollection
383383
{
384-
return $this->fetch(['UID'], (array) $msgns, null, ImapFetchIdentifier::MessageNumber);
384+
return $this->fetch(['UID'], (array) $ids, null, $identifier);
385385
}
386386

387387
/**

0 commit comments

Comments
 (0)