git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11954
7612ce4b-ef26-0410-bec9-
ea0150e637f0
* @param resource $imap_stream imap connection
* @param integer $id uid of the message
* @param string $mailbox used for error handling, can be removed because we should return an error code and generate the message elsewhere
* @param resource $imap_stream imap connection
* @param integer $id uid of the message
* @param string $mailbox used for error handling, can be removed because we should return an error code and generate the message elsewhere
- * @return Message Message object
+ * @param int $hide Indicates whether or not to hide any errors: 0 = don't hide, 1 = hide (just exit), 2 = hide (return FALSE) (OPTIONAL; default don't hide)
+ * @return mixed Message object or FALSE if error occurred and $hide is set to 2
-function sqimap_get_message($imap_stream, $id, $mailbox) {
+function sqimap_get_message($imap_stream, $id, $mailbox, $hide=0) {
// typecast to int to prohibit 1:* msgs sets
$id = (int) $id;
$flags = array();
// typecast to int to prohibit 1:* msgs sets
$id = (int) $id;
$flags = array();
+
+ if ($hide == 1) exit;
+ if ($hide == 2) return FALSE;
+
/* the message was not found, maybe the mailbox was modified? */
global $sort, $startMessage, $color;
/* the message was not found, maybe the mailbox was modified? */
global $sort, $startMessage, $color;