|
@@ -328,7 +328,7 @@ function sqimap_subscribe ($imap_stream, $mailbox) {
|
|
function sqimap_unsubscribe ($imap_stream, $mailbox) {
|
|
function sqimap_unsubscribe ($imap_stream, $mailbox) {
|
|
$read_ary = sqimap_run_command($imap_stream, 'UNSUBSCRIBE ' .
|
|
$read_ary = sqimap_run_command($imap_stream, 'UNSUBSCRIBE ' .
|
|
sqimap_encode_mailbox_name($mailbox),
|
|
sqimap_encode_mailbox_name($mailbox),
|
|
- true, $response, $message);
|
|
|
|
|
|
+ false, $response, $message);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -336,12 +336,17 @@ function sqimap_unsubscribe ($imap_stream, $mailbox) {
|
|
*/
|
|
*/
|
|
function sqimap_mailbox_delete ($imap_stream, $mailbox) {
|
|
function sqimap_mailbox_delete ($imap_stream, $mailbox) {
|
|
global $data_dir, $username;
|
|
global $data_dir, $username;
|
|
|
|
+ sqimap_unsubscribe ($imap_stream, $mailbox);
|
|
$read_ary = sqimap_run_command($imap_stream, 'DELETE ' .
|
|
$read_ary = sqimap_run_command($imap_stream, 'DELETE ' .
|
|
sqimap_encode_mailbox_name($mailbox),
|
|
sqimap_encode_mailbox_name($mailbox),
|
|
true, $response, $message);
|
|
true, $response, $message);
|
|
- sqimap_unsubscribe ($imap_stream, $mailbox);
|
|
|
|
- do_hook_function('rename_or_delete_folder', $args = array($mailbox, 'delete', ''));
|
|
|
|
- removePref($data_dir, $username, "thread_$mailbox");
|
|
|
|
|
|
+ if ($response !== 'OK') {
|
|
|
|
+ // subscribe again
|
|
|
|
+ sqimap_subscribe ($imap_stream, $mailbox);
|
|
|
|
+ } else {
|
|
|
|
+ do_hook_function('rename_or_delete_folder', $args = array($mailbox, 'delete', ''));
|
|
|
|
+ removePref($data_dir, $username, "thread_$mailbox");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|