Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/IMAP
diff options
context:
space:
mode:
authorGretaD <gretadoci@gmail.com>2020-03-06 18:50:26 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-08-10 13:58:52 +0300
commita543bbcd4bd22182dd1340353854229a6f0589e9 (patch)
tree2210c286f8395384a452e965c1d54bbc7b84d527 /lib/IMAP
parent424624f24d864b372275f2938c6ab7bb17fd673c (diff)
Add delete action for folders
Signed-off-by: GretaD <gretadoci@gmail.com> Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/IMAP')
-rw-r--r--lib/IMAP/FolderMapper.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/IMAP/FolderMapper.php b/lib/IMAP/FolderMapper.php
index 434ef68ea..6b60e1ed8 100644
--- a/lib/IMAP/FolderMapper.php
+++ b/lib/IMAP/FolderMapper.php
@@ -219,4 +219,17 @@ class FolderMapper {
}
}
}
+
+ /**
+ * @param Horde_Imap_Client_Socket $client
+ * @param string $folderId
+ * @throws ServiceException
+ */
+ public function delete(Horde_Imap_Client_Socket $client, string $folderId): void {
+ try {
+ $client->deleteMailbox($folderId);
+ } catch (Horde_Imap_Client_Exception $e) {
+ throw new ServiceException('Could not delete mailbox: '.$e->getMessage(), 0, $e);
+ }
+ }
}