Performance: Skip redundant LISTSCRIPTS command

pull/5735/head^2
Aleksander Machniak 7 years ago
parent 7456d7fbc6
commit 7647612f0c

@ -16,6 +16,7 @@ CHANGELOG Roundcube Webmail
- Fix addressbook searching by gender (#5757)
- Fix prevention from using % and * characters in folder name (#5762)
- Enigma: Fix compatibility with assets_dir
- Managesieve: Skip redundant LISTSCRIPTS command
RELEASE 1.3-rc
--------------

@ -1,5 +1,8 @@
* version 8.9 [2017-05-22]
-----------------------------------------------------------
- Fix handling of scripts with nested rules (#5540)
- Fix possible defect in handling \r\n in scripts (#5685)
- Performance: Skip redundant LISTSCRIPTS command
* version 8.8 [2016-11-27]
-----------------------------------------------------------

@ -29,6 +29,7 @@ class rcube_sieve
private $errorLines = array(); // array of line numbers within sieve script which raised an error
private $list = array(); // scripts list
private $exts; // array of supported extensions
private $active; // active script name
public $script; // rcube_sieve_script object
public $current; // name of currently loaded script
@ -215,6 +216,8 @@ class rcube_sieve
return $this->_set_error(self::ERROR_ACTIVATE);
}
$this->active = $name;
return true;
}
@ -233,6 +236,8 @@ class rcube_sieve
return $this->_set_error(self::ERROR_DEACTIVATE);
}
$this->active = null;
return true;
}
@ -256,6 +261,8 @@ class rcube_sieve
if (is_a($result, 'PEAR_Error')) {
return $this->_set_error(self::ERROR_DELETE);
}
$this->active = null;
}
$result = $this->sieve->removeScript($name);
@ -268,6 +275,8 @@ class rcube_sieve
$this->current = null;
}
$this->list = null;
return true;
}
@ -316,13 +325,14 @@ class rcube_sieve
return $this->_set_error(self::ERROR_INTERNAL);
}
$list = $this->sieve->listScripts();
$list = $this->sieve->listScripts($active);
if (is_a($list, 'PEAR_Error')) {
return $this->_set_error(self::ERROR_OTHER);
}
$this->list = $list;
$this->list = $list;
$this->active = $active;
}
return $this->list;
@ -333,11 +343,15 @@ class rcube_sieve
*/
public function get_active()
{
if ($this->active !== null) {
return $this->active;
}
if (!$this->sieve) {
return $this->_set_error(self::ERROR_INTERNAL);
}
return $this->sieve->getActive();
return $this->active = $this->sieve->getActive();
}
/**

Loading…
Cancel
Save