@@ -236,7 +236,7 @@ public function getChildren(): FolderCollection {
236
236
protected function decodeName ($ name ): string |array |bool |null {
237
237
$ parts = [];
238
238
foreach (explode ($ this ->delimiter , $ name ) as $ item ) {
239
- $ parts [] = EncodingAliases::convert ($ item , "UTF7-IMAP " , " UTF-8 " );
239
+ $ parts [] = EncodingAliases::convert ($ item , "UTF7-IMAP " );
240
240
}
241
241
242
242
return implode ($ this ->delimiter , $ parts );
@@ -310,7 +310,7 @@ public function move(string $new_name, bool $expunge = true): array {
310
310
public function overview (string $ sequence = null ): array {
311
311
$ this ->client ->openFolder ($ this ->path );
312
312
$ 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 );
314
314
$ response = $ this ->client ->getConnection ()->overview ($ sequence , $ uid );
315
315
return $ response ->validatedData ();
316
316
}
@@ -378,7 +378,7 @@ public function rename(string $new_name, bool $expunge = true): array {
378
378
public function delete (bool $ expunge = true ): array {
379
379
$ status = $ this ->client ->getConnection ()->deleteFolder ($ this ->path )->validatedData ();
380
380
if ($ this ->client ->getActiveFolder () == $ this ->path ){
381
- $ this ->client ->setActiveFolder (null );
381
+ $ this ->client ->setActiveFolder ();
382
382
}
383
383
384
384
if ($ expunge ) $ this ->client ->expunge ();
@@ -501,7 +501,7 @@ public function idle(callable $callback, int $timeout = 300): void {
501
501
}
502
502
503
503
/**
504
- * Get folder status information
504
+ * Get folder status information from the EXAMINE command
505
505
*
506
506
* @return array
507
507
* @throws ConnectionFailedException
@@ -511,20 +511,39 @@ public function idle(callable $callback, int $timeout = 300): void {
511
511
* @throws AuthFailedException
512
512
* @throws ResponseException
513
513
*/
514
- public function getStatus (): array {
515
- return $ this ->examine ();
514
+ public function status (): array {
515
+ return $ this ->client -> getConnection ()-> folderStatus ( $ this -> path )-> validatedData ();
516
516
}
517
517
518
518
/**
519
+ * Get folder status information from the EXAMINE command
520
+ *
521
+ * @return array
522
+ * @throws AuthFailedException
519
523
* @throws ConnectionFailedException
520
524
* @throws ImapBadRequestException
521
525
* @throws ImapServerErrorException
526
+ * @throws ResponseException
522
527
* @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
523
538
* @throws AuthFailedException
539
+ * @throws ConnectionFailedException
540
+ * @throws ImapBadRequestException
541
+ * @throws ImapServerErrorException
524
542
* @throws ResponseException
543
+ * @throws RuntimeException
525
544
*/
526
545
public function loadStatus (): Folder {
527
- $ this ->status = $ this ->getStatus ();
546
+ $ this ->status = $ this ->examine ();
528
547
return $ this ;
529
548
}
530
549
@@ -573,7 +592,7 @@ public function getClient(): Client {
573
592
*/
574
593
public function setDelimiter ($ delimiter ): void {
575
594
if (in_array ($ delimiter , [null , '' , ' ' , false ]) === true ) {
576
- $ delimiter = ClientManager:: get ('options.delimiter ' , '/ ' );
595
+ $ delimiter = $ this -> client -> getConfig ()-> get ('options.delimiter ' , '/ ' );
577
596
}
578
597
579
598
$ this ->delimiter = $ delimiter ;
0 commit comments