From: tassium Date: Fri, 10 Jan 2003 15:48:49 +0000 (+0000) Subject: Removed function sqimap_mailbox_has_children() from imap_mailbox.php X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=4d5537d1f0a7800248d353f8e1776c36864ada6d;p=squirrelmail.git Removed function sqimap_mailbox_has_children() from imap_mailbox.php Marc pointed out that \HasChildren is an extension, not part of IMAP4rev1. Got the effect I needed from already existing code. Summary: Display purge link for trash in all cases, this time done in accordance with RFC 2060. (Eliminates an extra IMAP call, too.) git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4409 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/ChangeLog b/ChangeLog index 1925483a..cbcb6bdd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,7 +19,6 @@ Version 1.4.0 RC 2 - Prevent endless loop when timezone config is not found. Thanks Joshua Colson. - Fix IMAP error when returning to message from viewing image attachment. - Do more trimming to indented subjects in threadview so they don't wrap. - - New function in imap_mailbox.php: sqimap_mailbox_has_children. - Trash folder now displays purge link in all cases. (Closes #655943) diff --git a/functions/imap_mailbox.php b/functions/imap_mailbox.php index ede0e493..8553beca 100755 --- a/functions/imap_mailbox.php +++ b/functions/imap_mailbox.php @@ -937,35 +937,4 @@ function sqimap_fill_mailbox_tree($mbx_ary, $mbxs=false) { return $mailboxes; } -function sqimap_mailbox_has_children($mailbox='INBOX',$stream=false) { - if (!$stream) { - /* We weren't provided an IMAP stream - make one */ - global $username,$imapServerAddress, $imapPort; - $password=$_COOKIE['key']; - $stream=sqimap_login($username,$password,$imapServerAddress,$imapPort,false); - $log_this_out=true; - } - $query = 'LIST "" "' . $mailbox . '"'; - $results=sqimap_run_command($stream,$query,true,$response,$message,false); - if (isset($log_this_out)) { - /* It's our stream, and since we're done with it... */ - sqimap_logout($stream); - } - if (isset($results[0])) { - /* We got something back, let's parse the results */ - $pos = strpos($results[0], '\HasChildren'); - if ($pos === false) { - /* Folder has no children */ - return false; - } else { - /* Folder has children */ - return true; - } - } else { - /* Didn't get anything back, probably bad mailbox name */ - return false; - } - return true; -} - ?> diff --git a/src/left_main.php b/src/left_main.php index a95607ad..b6b2c12b 100644 --- a/src/left_main.php +++ b/src/left_main.php @@ -35,7 +35,6 @@ function formatMailboxName($imapConnection, $box_array) { $unseen_notify, $unseen_type, $collapse_folders, $draft_folder, $save_as_draft, $use_special_folder_color; - $real_box = $box_array['unformatted']; $mailbox = str_replace(' ','',$box_array['formatted']); $mailboxURL = urlencode($real_box); @@ -98,7 +97,7 @@ function formatMailboxName($imapConnection, $box_array) { $numMessages = sqimap_get_num_messages($imapConnection, $real_box); } - if (($numMessages > 0) or (sqimap_mailbox_has_children($trash_folder))) { + if (($numMessages > 0) or ($box_array['parent'] == 1)) { $urlMailbox = urlencode($real_box); $line .= "\n\n" . "  ("._("purge").")" .