}
if (!$success) {
$msg = $deliver->dlv_msg . '<br />' .
- _("Server replied: ") . $deliver->dlv_ret_nr . ' '.
+ _("Server replied:") . ' ' . $deliver->dlv_ret_nr . ' ' .
$deliver->dlv_server_msg;
require_once(SM_PATH . 'functions/display_messages.php');
plain_error_message($msg, $color);
// Prev/Next links for regular messages
} else if ( true ) { //!(isset($where) && isset($what)) ) {
- /**
- * Check if cache is still valid
- */
- if (!is_array($aMailbox['UIDSET'][$what])) {
- fetchMessageHeaders($imapConnection, $aMailbox);
- }
$prev = findPreviousMessage($aMailbox['UIDSET'][$what], $passed_id);
$next = findNextMessage($aMailbox['UIDSET'][$what],$passed_id);
if (!sqgetGlobalVar('where', $where, SQ_GET) ) {
$where = 'right_main.php';
}
+/*
+ * Used as entry key to the list of uid's cached in the mailbox cache
+ * we use the cached uid's to get the next and prev message.
+ */
if (!sqgetGlobalVar('what', $what, SQ_GET) ){
$what = 0;
}
$aMailbox = sqm_api_mailbox_select($imapConnection, $iAccount, $mailbox,array('setindex' => $what, 'offset' => $startMessage),array());
/**
- * Check if cache is still valid
- */
-$iSetIndex = $aMailbox['SETINDEX'];
-$aMailbox['CURRENT_MSG'][$iSetIndex] = $passed_id;
-//$aMailbox['OFFSET'] = $startMessage -1;
-
-sqgetGlobalVar('aFetchColumns',$aFetchColumns,SQ_SESSION);
+ * Check if cache is still valid, $what contains the key
+ * which gives us acces to the array with uid's. At this moment
+ * 0 is used for a normal message list and search uses 1 as key. This can be
+ * changed / extended in the future.
+ * If on a select of a mailbox we detect that the cache should be invalidated due to
+ * the delete of messages or due to new messages we empty the list with uid's and
+ * that's what we detect below.
+ */
if (!is_array($aMailbox['UIDSET'][$what])) {
- fetchMessageHeaders($imapConnection, $aMailbox, $aFetchColumns);
+ fetchMessageHeaders($imapConnection, $aMailbox);
}
+$iSetIndex = $aMailbox['SETINDEX'];
+$aMailbox['CURRENT_MSG'][$iSetIndex] = $passed_id;
+
/**
* Update the seen state
* and ignore in_array('\\seen',$aMailbox['PERMANENTFLAGS'],true)
}
}
-displayPageHeader($color, $mailbox);
+displayPageHeader($color, $mailbox,'','');
formatMenuBar($aMailbox, $passed_id, $passed_ent_id, $message,false);
formatEnvheader($aMailbox, $passed_id, $passed_ent_id, $message, $color, $FirstTimeSee);
echo '<table width="100%" cellpadding="0" cellspacing="0" align="center" border="0">';
echo ' <table width="100%" cellpadding="3" cellspacing="0" align="center" border="0">';
echo ' <tr bgcolor="'.$color[4].'"><td>';
// echo ' <table cellpadding="1" cellspacing="5" align="left" border="0">';
-echo html_tag( 'table' ,'' , 'left', '', 'cellpadding="1" cellspacing="5" border="0"' );
+echo html_tag( 'table' ,'' , 'left', '', 'width="100%" cellpadding="1" cellspacing="5" border="0"' );
echo ' <tr>' . html_tag( 'td', '<br />'. $messagebody."\n", 'left')
. '</tr>';
echo ' </table>';