/**
* imap_messages.php
*
- * Copyright (c) 1999-2005 The SquirrelMail Project Team
- * Licensed under the GNU GPL. For full terms see the file COPYING.
- *
* This implements functions that manipulate messages
* NOTE: Quite a few functions in this file are obsolete
*
+ * @copyright © 1999-2005 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @package squirrelmail
* @subpackage imap
* X-MS-Mail-Priority is not parsed because it always coincides
* with one of the other headers.
*
- * DUPLICATE CODE ALERT:
+ * FIXME: DUPLICATE CODE ALERT:
* NOTE: this is actually a duplicate from the function in
* class/mime/Rfc822Header.php.
+ * @todo obsolate function or use it instead of code block in parseFetch()
*/
-function parsePriority($value) {
- $value = strtolower(array_shift(split('/\w/',trim($value))));
+function parsePriority($sValue) {
+ $aValue = split('/\w/',trim($sValue));
+ $value = strtolower(array_shift($aValue));
if ( is_numeric($value) ) {
return $value;
}
case 'priority':
case 'importance':
if (!isset($aMsg['x-priority'])) {
- $value = strtolower(array_shift(split('/\w/',trim($value))));
- if (is_numeric($value)) {
- $value = (int) $value;
- } elseif ( $value == 'non-urgent' || $value == 'low' ) {
- $value = 3;
- } elseif ( $value == 'urgent' || $value == 'high' ) {
- $value = 1;
+ $aPrio = split('/\w/',trim($value));
+ $sPrio = strtolower(array_shift($aPrio));
+ if (is_numeric($sPrio)) {
+ $iPrio = (int) $sPrio;
+ } elseif ( $sPrio == 'non-urgent' || $sPrio == 'low' ) {
+ $iPrio = 3;
+ } elseif ( $sPrio == 'urgent' || $sPrio == 'high' ) {
+ $iPrio = 1;
} else {
// default is normal priority
- $value = 3;
+ $iPrio = 3;
}
- $aMsg['x-priority'] = $value;
+ $aMsg['x-priority'] = $iPrio;
}
break;
case 'content-type':
}
}
$msgi ="$unique_id";
- $msg['UID'] = $unique_id;
+ $aMsg['UID'] = $unique_id;
$aMessageList[$msgi] = $aMsg;
}
return $aMessageList;