|
@@ -28,10 +28,10 @@ require_once('../functions/smtp.php');
|
|
*/
|
|
*/
|
|
function findNextMessage() {
|
|
function findNextMessage() {
|
|
global $msort, $currentArrayIndex, $msgs, $sort,
|
|
global $msort, $currentArrayIndex, $msgs, $sort,
|
|
- $allow_thread_sort, $allow_server_sort,
|
|
|
|
|
|
+ $thread_sort_messages, $allow_server_sort,
|
|
$server_sort_array;
|
|
$server_sort_array;
|
|
$result = -1;
|
|
$result = -1;
|
|
- if ($allow_thread_sort == true || $allow_server_sort == true) {
|
|
|
|
|
|
+ if ($thread_sort_messages == 1 || $allow_server_sort == 'true') {
|
|
reset($server_sort_array);
|
|
reset($server_sort_array);
|
|
while(list($key, $value) = each ($server_sort_array)) {
|
|
while(list($key, $value) = each ($server_sort_array)) {
|
|
if ($currentArrayIndex == $value) {
|
|
if ($currentArrayIndex == $value) {
|
|
@@ -44,13 +44,13 @@ function findNextMessage() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- elseif ($sort == 6 && $allow_server_sort != true &&
|
|
|
|
- $allow_thread_sort != true) {
|
|
|
|
|
|
+ elseif ($sort == 6 && $allow_server_sort != 'true' &&
|
|
|
|
+ $thread_sort_messages != 1) {
|
|
if ($currentArrayIndex != 1) {
|
|
if ($currentArrayIndex != 1) {
|
|
$result = $currentArrayIndex - 1;
|
|
$result = $currentArrayIndex - 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- elseif ($allow_server_sort != true && $allow_thread_sort != true) {
|
|
|
|
|
|
+ elseif ($allow_server_sort != 'true' && $thread_sort_messages != 1 ) {
|
|
if (!is_array($msort)) {
|
|
if (!is_array($msort)) {
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
@@ -86,10 +86,10 @@ function RemoveAddress(&$addr_list, $addr) {
|
|
/** returns the index of the previous message from the array. */
|
|
/** returns the index of the previous message from the array. */
|
|
function findPreviousMessage() {
|
|
function findPreviousMessage() {
|
|
global $msort, $currentArrayIndex, $sort, $msgs, $imapConnection,
|
|
global $msort, $currentArrayIndex, $sort, $msgs, $imapConnection,
|
|
- $mailbox, $data_dir, $username, $allow_thread_sort,
|
|
|
|
|
|
+ $mailbox, $data_dir, $username, $thread_sort_messages,
|
|
$allow_server_sort, $server_sort_array;
|
|
$allow_server_sort, $server_sort_array;
|
|
$result = -1;
|
|
$result = -1;
|
|
- if ($allow_thread_sort == true || $allow_server_sort == TRUE) {
|
|
|
|
|
|
+ if ($thread_sort_messages == 1 || $allow_server_sort == 'true') {
|
|
reset($server_sort_array);
|
|
reset($server_sort_array);
|
|
while(list($key, $value) = each ($server_sort_array)) {
|
|
while(list($key, $value) = each ($server_sort_array)) {
|
|
if ($currentArrayIndex == $value) {
|
|
if ($currentArrayIndex == $value) {
|
|
@@ -102,14 +102,14 @@ function findPreviousMessage() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- elseif ($sort == 6 && $allow_server_sort != TRUE &&
|
|
|
|
- $allow_thread_sort != true) {
|
|
|
|
|
|
+ elseif ($sort == 6 && $allow_server_sort != 'true' &&
|
|
|
|
+ $thread_sort_messages != 1) {
|
|
$numMessages = sqimap_get_num_messages($imapConnection, $mailbox);
|
|
$numMessages = sqimap_get_num_messages($imapConnection, $mailbox);
|
|
if ($currentArrayIndex != $numMessages) {
|
|
if ($currentArrayIndex != $numMessages) {
|
|
$result = $currentArrayIndex + 1;
|
|
$result = $currentArrayIndex + 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- elseif ($allow_thread_sort != true && $allow_server_sort != TRUE) {
|
|
|
|
|
|
+ elseif ($thread_sort_messages != 1 && $allow_server_sort != 'true') {
|
|
if (!is_array($msort)) {
|
|
if (!is_array($msort)) {
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|