Skip to content

Commit bd1614d

Browse files
committed
Merge conflict resolved Webklex#445
1 parent 279ad47 commit bd1614d

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

src/Folder.php

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ public function getChildren(): FolderCollection {
236236
protected function decodeName($name): string|array|bool|null {
237237
$parts = [];
238238
foreach (explode($this->delimiter, $name) as $item) {
239-
$parts[] = EncodingAliases::convert($item, "UTF7-IMAP", "UTF-8");
239+
$parts[] = EncodingAliases::convert($item, "UTF7-IMAP");
240240
}
241241

242242
return implode($this->delimiter, $parts);
@@ -310,7 +310,7 @@ public function move(string $new_name, bool $expunge = true): array {
310310
public function overview(string $sequence = null): array {
311311
$this->client->openFolder($this->path);
312312
$sequence = $sequence === null ? "1:*" : $sequence;
313-
$uid = ClientManager::get('options.sequence', IMAP::ST_MSGN);
313+
$uid = $this->client->getConfig()->get('options.sequence', IMAP::ST_MSGN);
314314
$response = $this->client->getConnection()->overview($sequence, $uid);
315315
return $response->validatedData();
316316
}
@@ -378,7 +378,7 @@ public function rename(string $new_name, bool $expunge = true): array {
378378
public function delete(bool $expunge = true): array {
379379
$status = $this->client->getConnection()->deleteFolder($this->path)->validatedData();
380380
if ($this->client->getActiveFolder() == $this->path){
381-
$this->client->setActiveFolder(null);
381+
$this->client->setActiveFolder();
382382
}
383383

384384
if ($expunge) $this->client->expunge();
@@ -501,7 +501,7 @@ public function idle(callable $callback, int $timeout = 300): void {
501501
}
502502

503503
/**
504-
* Get folder status information
504+
* Get folder status information from the EXAMINE command
505505
*
506506
* @return array
507507
* @throws ConnectionFailedException
@@ -511,20 +511,39 @@ public function idle(callable $callback, int $timeout = 300): void {
511511
* @throws AuthFailedException
512512
* @throws ResponseException
513513
*/
514-
public function getStatus(): array {
515-
return $this->examine();
514+
public function status(): array {
515+
return $this->client->getConnection()->folderStatus($this->path)->validatedData();
516516
}
517517

518518
/**
519+
* Get folder status information from the EXAMINE command
520+
*
521+
* @return array
522+
* @throws AuthFailedException
519523
* @throws ConnectionFailedException
520524
* @throws ImapBadRequestException
521525
* @throws ImapServerErrorException
526+
* @throws ResponseException
522527
* @throws RuntimeException
528+
*
529+
* @deprecated Use Folder::status() instead
530+
*/
531+
public function getStatus(): array {
532+
return $this->status();
533+
}
534+
535+
/**
536+
* Load folder status information from the EXAMINE command
537+
* @return Folder
523538
* @throws AuthFailedException
539+
* @throws ConnectionFailedException
540+
* @throws ImapBadRequestException
541+
* @throws ImapServerErrorException
524542
* @throws ResponseException
543+
* @throws RuntimeException
525544
*/
526545
public function loadStatus(): Folder {
527-
$this->status = $this->getStatus();
546+
$this->status = $this->examine();
528547
return $this;
529548
}
530549

@@ -573,7 +592,7 @@ public function getClient(): Client {
573592
*/
574593
public function setDelimiter($delimiter): void {
575594
if (in_array($delimiter, [null, '', ' ', false]) === true) {
576-
$delimiter = ClientManager::get('options.delimiter', '/');
595+
$delimiter = $this->client->getConfig()->get('options.delimiter', '/');
577596
}
578597

579598
$this->delimiter = $delimiter;

0 commit comments

Comments
 (0)