diff options
author | Aleksander Machniak <alec@alec.pl> | 2013-08-29 09:20:33 +0200 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2013-08-29 09:23:52 +0200 |
commit | c1a0b072424568957eb686a049d8419e4d96c476 (patch) | |
tree | 5eee76a7ab855bc6cbe5929fe89a61f1d874dfa7 /program/lib/Roundcube/rcube_imap.php | |
parent | 5df7179b32e363ad0c7c2c3d6d8b5411252c9402 (diff) |
Fix setting of Junk and NonJunk flags by markasjunk plugin (#1489285)
Added possibility to register flag mappings by a plugin.
Conflicts:
plugins/markasjunk/markasjunk.php
program/lib/Roundcube/rcube_imap_generic.php
Diffstat (limited to 'program/lib/Roundcube/rcube_imap.php')
-rw-r--r-- | program/lib/Roundcube/rcube_imap.php | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php index 356f4f1db..ca5e35f2c 100644 --- a/program/lib/Roundcube/rcube_imap.php +++ b/program/lib/Roundcube/rcube_imap.php @@ -70,7 +70,7 @@ class rcube_imap extends rcube_storage protected $search_sort_field = ''; protected $search_threads = false; protected $search_sorted = false; - protected $options = array('auth_method' => 'check'); + protected $options = array('auth_type' => 'check'); protected $caching = false; protected $messages_caching = false; protected $threading = false; @@ -398,10 +398,10 @@ class rcube_imap extends rcube_storage public function check_permflag($flag) { $flag = strtoupper($flag); - $imap_flag = $this->conn->flags[$flag]; $perm_flags = $this->get_permflags($this->folder); + $imap_flag = $this->conn->flags[$flag]; - return in_array_nocase($imap_flag, $perm_flags); + return $imap_flag && !empty($perm_flags) && in_array_nocase($imap_flag, $perm_flags); } @@ -417,17 +417,7 @@ class rcube_imap extends rcube_storage if (!strlen($folder)) { return array(); } -/* - Checking PERMANENTFLAGS is rather rare, so we disable caching of it - Re-think when we'll use it for more than only MDNSENT flag - $cache_key = 'mailboxes.permanentflags.' . $folder; - $permflags = $this->get_cache($cache_key); - - if ($permflags !== null) { - return explode(' ', $permflags); - } -*/ if (!$this->check_connection()) { return array(); } @@ -442,10 +432,7 @@ class rcube_imap extends rcube_storage if (!is_array($permflags)) { $permflags = array(); } -/* - // Store permflags as string to limit cached object size - $this->update_cache($cache_key, implode(' ', $permflags)); -*/ + return $permflags; } |