Minor cleanups
This commit is contained in:
parent
ea21e88ad2
commit
b9788abcfa
1 changed files with 80 additions and 63 deletions
|
@ -16,11 +16,11 @@
|
|||
|
||||
|
||||
/**
|
||||
* copy a set of messages ($id) to another mailbox ($mailbox)
|
||||
* Copy a set of messages ($id) to another mailbox ($mailbox)
|
||||
* @param int $imap_stream The resource ID for the IMAP socket
|
||||
* @param string $id The list of messages to copy
|
||||
* @param string $mailbox The destination to copy to
|
||||
* @return void
|
||||
* @return bool
|
||||
*/
|
||||
function sqimap_msgs_list_copy($imap_stream, $id, $mailbox) {
|
||||
$msgs_id = sqimap_message_list_squisher($id);
|
||||
|
@ -32,8 +32,9 @@ function sqimap_msgs_list_copy ($imap_stream, $id, $mailbox) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* move a set of messages ($id) to another mailbox. Deletes the originals.
|
||||
* Move a set of messages ($id) to another mailbox. Deletes the originals.
|
||||
* @param int $imap_stream The resource ID for the IMAP socket
|
||||
* @param string $id The list of messages to move
|
||||
* @param string $mailbox The destination to move to
|
||||
|
@ -74,7 +75,6 @@ function sqimap_msgs_list_delete ($imap_stream, $mailbox, $id, $bypass_trash=fal
|
|||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Set a flag on the provided uid list
|
||||
* @param resource imap connection
|
||||
|
@ -92,6 +92,7 @@ function sqimap_toggle_flag($imap_stream, $id, $flag, $set, $handle_errors) {
|
|||
return parseFetch($aResponse);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sort the message list and crunch to be as small as possible
|
||||
* (overflow could happen, so make it small if possible)
|
||||
|
@ -120,6 +121,7 @@ function sqimap_message_list_squisher($messages_array) {
|
|||
return $msgs_str;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves an array with a sorted uid list. Sorting is done on the imap server
|
||||
* @link http://www.ietf.org/internet-drafts/draft-ietf-imapext-sort-17.txt
|
||||
|
@ -266,6 +268,7 @@ function get_squirrel_sort ($imap_stream, $sSortField, $reverse = false, $aUid =
|
|||
return $aUid;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns an indent array for printMessageinfo()
|
||||
* This represents the amount of indent needed (value),
|
||||
|
@ -481,6 +484,7 @@ function elapsedTime($start) {
|
|||
return $timepassed;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Parses a string in an imap response. String starts with " or { which means it
|
||||
* can handle double quoted strings and literal strings
|
||||
|
@ -531,6 +535,7 @@ function parseString($read,&$i) {
|
|||
return $s;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Parses a string containing an array from an imap response. String starts with ( and end with )
|
||||
*
|
||||
|
@ -550,6 +555,8 @@ function parseArray($read,&$i) {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves a list with headers, flags, size or internaldate from the imap server
|
||||
* @param resource $imap_stream imap connection
|
||||
|
@ -605,6 +612,7 @@ function sqimap_get_small_header_list ($imap_stream, $msg_list,
|
|||
return $aMessages;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Parses a fetch response, currently it can hande FLAGS, HEADERS, RFC822.SIZE, INTERNALDATE and UID
|
||||
* @param array $aResponse Imap response
|
||||
|
@ -756,6 +764,7 @@ function parseFetch($aResponse,$aMessageList = array()) {
|
|||
return $aMessageList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Work in process
|
||||
* @private
|
||||
|
@ -836,6 +845,7 @@ function sqimap_parse_envelope($read, &$i, &$msg) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Work in process
|
||||
* @private
|
||||
|
@ -873,6 +883,7 @@ function sqimap_parse_address($read, &$i) {
|
|||
return $adr;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a message array with all the information about a message.
|
||||
* See the documentation folder for more information about this array.
|
||||
|
@ -912,15 +923,17 @@ function sqimap_get_message ($imap_stream, $id, $mailbox) {
|
|||
return $msg;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Depricated !!!!!!! DO NOT USE THIS, use sqimap_msgs_list_copy instead
|
||||
* Deprecated !!!!!!! DO NOT USE THIS, use sqimap_msgs_list_copy instead
|
||||
*/
|
||||
function sqimap_messages_copy($imap_stream, $start, $end, $mailbox) {
|
||||
$read = sqimap_run_command ($imap_stream, "COPY $start:$end " . sqimap_encode_mailbox_name($mailbox), true, $response, $message, TRUE);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Depricated !!!!!!! DO NOT USE THIS, use sqimap_msgs_list_delete instead
|
||||
* Deprecated !!!!!!! DO NOT USE THIS, use sqimap_msgs_list_delete instead
|
||||
*/
|
||||
function sqimap_messages_delete($imap_stream, $start, $end, $mailbox, $bypass_trash=false) {
|
||||
global $move_to_trash, $trash_folder, $auto_expunge;
|
||||
|
@ -932,8 +945,9 @@ function sqimap_messages_delete ($imap_stream, $start, $end, $mailbox, $bypass_t
|
|||
sqimap_messages_flag ($imap_stream, $start, $end, "Deleted", true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Depricated !!!!!!! DO NOT USE THIS, use sqimap_toggle_flag instead
|
||||
* Deprecated !!!!!!! DO NOT USE THIS, use sqimap_toggle_flag instead
|
||||
* Set a flag on the provided uid list
|
||||
* @param resource imap connection
|
||||
*/
|
||||
|
@ -941,7 +955,10 @@ function sqimap_messages_flag ($imap_stream, $start, $end, $flag, $handle_errors
|
|||
$read = sqimap_run_command ($imap_stream, "STORE $start:$end +FLAGS (\\$flag)", $handle_errors, $response, $message, TRUE);
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
function sqimap_get_small_header($imap_stream, $id, $sent) {
|
||||
$res = sqimap_get_small_header_list($imap_stream, $id, $sent);
|
||||
return $res[0];
|
||||
|
|
Loading…
Add table
Reference in a new issue