Skip to content

Commit 88f28e4

Browse files
loc4lRene Rudnick
andauthored
Copy/Move Message with utf7 folder path (Webklex#559)
Messages can be moved/copied to a folder with umlauts. Co-authored-by: Rene Rudnick <[email protected]>
1 parent f8d5f34 commit 88f28e4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Message.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -983,6 +983,7 @@ protected function fetchThreadByMessageId(MessageCollection &$thread, string $me
983983
* Copy the current Messages to a mailbox
984984
* @param string $folder_path
985985
* @param boolean $expunge
986+
* @param bool $utf7
986987
*
987988
* @return null|Message
988989
* @throws AuthFailedException
@@ -999,7 +1000,7 @@ protected function fetchThreadByMessageId(MessageCollection &$thread, string $me
9991000
* @throws RuntimeException
10001001
* @throws ResponseException
10011002
*/
1002-
public function copy(string $folder_path, bool $expunge = false): ?Message {
1003+
public function copy(string $folder_path, bool $expunge = false, bool $utf7 = false): ?Message {
10031004
$this->client->openFolder($folder_path);
10041005
$status = $this->client->getConnection()->examineFolder($folder_path)->validatedData();
10051006

@@ -1010,7 +1011,7 @@ public function copy(string $folder_path, bool $expunge = false): ?Message {
10101011
}
10111012

10121013
/** @var Folder $folder */
1013-
$folder = $this->client->getFolderByPath($folder_path);
1014+
$folder = $this->client->getFolderByPath($folder_path, $utf7);
10141015

10151016
$this->client->openFolder($this->folder_path);
10161017
if ($this->client->getConnection()->copyMessage($folder->path, $this->getSequenceId(), null, $this->sequence)->validatedData()) {
@@ -1025,6 +1026,7 @@ public function copy(string $folder_path, bool $expunge = false): ?Message {
10251026
* Move the current Messages to a mailbox
10261027
* @param string $folder_path
10271028
* @param boolean $expunge
1029+
* @param bool $utf7
10281030
*
10291031
* @return Message|null
10301032
* @throws AuthFailedException
@@ -1041,7 +1043,7 @@ public function copy(string $folder_path, bool $expunge = false): ?Message {
10411043
* @throws RuntimeException
10421044
* @throws ResponseException
10431045
*/
1044-
public function move(string $folder_path, bool $expunge = false): ?Message {
1046+
public function move(string $folder_path, bool $expunge = false, bool $utf7 = false): ?Message {
10451047
$this->client->openFolder($folder_path);
10461048
$status = $this->client->getConnection()->examineFolder($folder_path)->validatedData();
10471049

@@ -1052,7 +1054,7 @@ public function move(string $folder_path, bool $expunge = false): ?Message {
10521054
}
10531055

10541056
/** @var Folder $folder */
1055-
$folder = $this->client->getFolderByPath($folder_path);
1057+
$folder = $this->client->getFolderByPath($folder_path, $utf7);
10561058

10571059
$this->client->openFolder($this->folder_path);
10581060
if ($this->client->getConnection()->moveMessage($folder->path, $this->getSequenceId(), null, $this->sequence)->validatedData()) {

0 commit comments

Comments
 (0)