Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/Horde/Imap/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ class Horde_Imap_Client
/* @since 2.11.0 */
const FETCH_DOWNGRADED = 16;

const FETCH_FLAGS_ORIGINAL_CASE = 999;

/* Namespace constants. @deprecated */
const NS_PERSONAL = 1;
const NS_OTHER = 2;
Expand Down
16 changes: 15 additions & 1 deletion lib/Horde/Imap/Client/Data/Fetch.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,11 @@ public function getEnvelope()
*/
public function setFlags(array $flags)
{
$trimmed = array_map('trim', $flags);
$this->_data[Horde_Imap_Client::FETCH_FLAGS_ORIGINAL_CASE] = $trimmed;
$this->_data[Horde_Imap_Client::FETCH_FLAGS] = array_map(
'Horde_String::lower',
array_map('trim', $flags)
$trimmed
);
}

Expand All @@ -343,6 +345,18 @@ public function getFlags()
: array();
}

/**
* Get IMAP flags without changing their case.
*
* @return array An array of IMAP flags with their original case
*/
public function getFlagsOriginalCase()
{
return isset($this->_data[Horde_Imap_Client::FETCH_FLAGS_ORIGINAL_CASE])
? $this->_data[Horde_Imap_Client::FETCH_FLAGS_ORIGINAL_CASE]
: array();
}

/**
* Set IMAP internal date.
*
Expand Down