generated from Nodarx/template
feat: initial version
Signed-off-by: Sebastian Krupinski <root@LAPTOP-7DVOR6NC>
This commit was merged in pull request #1.
This commit is contained in:
38
lib/Service/Remote/Command/CopyCommand.php
Normal file
38
lib/Service/Remote/Command/CopyCommand.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: Sebastian Krupinski <krupinski01@gmail.com>
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace KTXM\ProviderImapMail\Service\Remote\Command;
|
||||
|
||||
use Gricob\IMAP\Protocol\Command\Command;
|
||||
use Gricob\IMAP\Protocol\Command\Argument\QuotedString;
|
||||
use Gricob\IMAP\Protocol\Command\Argument\SequenceSet;
|
||||
|
||||
/**
|
||||
* Raw UID COPY command.
|
||||
*
|
||||
* gricob does not expose message copying; this thin wrapper fills the gap.
|
||||
* Accepts a set of UIDs formatted as a comma-separated sequence set.
|
||||
*
|
||||
* Example: UID COPY 1,3,7 "INBOX.Archive"
|
||||
*/
|
||||
final readonly class CopyCommand extends Command
|
||||
{
|
||||
/**
|
||||
* @param int[] $uids Source message UIDs
|
||||
* @param string $destination Target mailbox name
|
||||
*/
|
||||
public function __construct(array $uids, string $destination)
|
||||
{
|
||||
parent::__construct(
|
||||
'UID COPY',
|
||||
new SequenceSet(...$uids),
|
||||
new QuotedString($destination),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user