From f69feefe3e23f06eba5291997a9cd1bd7a0238d6 Mon Sep 17 00:00:00 2001 From: philippe_mingo Date: Wed, 13 Feb 2002 14:23:31 +0000 Subject: [PATCH] Marc variant for the messages flags. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2431 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_mailbox.php | 35 ++++++++++++++++++++++----- src/read_body.php | 49 ++++++++------------------------------ 2 files changed, 39 insertions(+), 45 deletions(-) diff --git a/functions/imap_mailbox.php b/functions/imap_mailbox.php index e04d5bcf..7b0855e9 100755 --- a/functions/imap_mailbox.php +++ b/functions/imap_mailbox.php @@ -85,14 +85,14 @@ function sqimap_mailbox_exists ($imap_stream, $mailbox) ** Selects a mailbox ******************************************************************************/ function sqimap_mailbox_select ($imap_stream, $mailbox, - $hide=TRUE, $recent=false) + $hide=TRUE, $recent=false, $extrainfo=false) { global $auto_expunge; - + if ( $mailbox == 'None' ) { return; } - + $read = sqimap_run_command($imap_stream, "SELECT \"$mailbox\"", TRUE, $response, $message); if ($recent) { @@ -107,14 +107,37 @@ function sqimap_mailbox_select ($imap_stream, $mailbox, $tmp = sqimap_run_command($imap_stream, 'EXPUNGE', false, $a, $b); } - return( $read ); + if (isset( $extroinfo ) && $extroinfo) { + $result = array(); + for ($i=0; $i \x36 */ + $ret = preg_match( '/(\x36MDNSent|\\\*)/i', $read ); return ( $ret ); } @@ -186,12 +169,7 @@ function SendMDN ( $recipient , $sender) { "\t" . _("Sent:") . ' ' . $senton . "\r\n" . "\r\n" . sprintf( _("Was displayed on %s"), $now ); -/* - $body = sprintf( _("This message sent on %s to %s with subject \"%s\" has been displayed on %s."), - $senton, $to, $subject, $now ) . - "\r\n" . - _("This is no guarantee that the message has been read or understood.") . "\r\n"; -*/ + // part2 (RFC2298) $original_recipient = $to; @@ -227,20 +205,13 @@ function SendMDN ( $recipient , $sender) { function ToggleMDNflag ( $set ) { - global $imapConnection, $passed_id, $mailbox; - + sqimap_mailbox_select($imapConnection, $mailbox); if ( $set ) { - $sg = '+'; - + sqimap_messages_flag ($imapConnection,$passed_id,$passed_id,"\$MDNSent"); } else { - $sg = '-'; + sqimap_messages_remove_flag ($imapConnection,$passed_id,$passed_id,"\$MDNSent"); } - - $cmd = 'STORE ' . $passed_id . ' ' . $sg . 'FLAGS ($MDNSent)'; - sqimap_mailbox_select($imapConnection, $mailbox); - $read = sqimap_run_command ($imapConnection, $cmd, true, $response, $readmessage); - } function ClearAttachments() { @@ -270,7 +241,7 @@ function ClearAttachments() { */ $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); -$read = sqimap_mailbox_select($imapConnection, $mailbox); +$read = sqimap_mailbox_select($imapConnection, $mailbox, false, true); do_hook('html_top'); @@ -280,9 +251,9 @@ do_hook('html_top'); if( $default_use_mdn && ( $mdn_user_support = getPref($data_dir, $username, 'mdn_user_support', $default_use_mdn) ) ) { - $supportMDN = ServerMDNSupport($read); + $supportMDN = ServerMDNSupport($read["PERMANENTFLAGS"]); $flags = sqimap_get_flags ($imapConnection, $passed_id); - $FirstTimeSee = !(in_array( 'Seen', $flags )); + $FirstTimeSee = !(in_array( '\\Seen', $flags )); } displayPageHeader($color, $mailbox); @@ -848,7 +819,7 @@ if ($default_use_mdn) { } } // when deleted or draft flag is set don't offer to send a MDN response - else if ( ereg('Draft',$read[0] || ereg('Deleted',$read[0])) ) { + else if ( ereg('\\Draft',$read[0] || ereg('\\Deleted',$read[0])) ) { echo '' . "" . _("Read receipt") . ': '. -- 2.25.1