summaryrefslogtreecommitdiff
path: root/roundcubemail/program/steps/mail/func.inc
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-07-04 12:59:37 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-07-04 12:59:37 +0000
commit250ef0eeba7ade37897c3fbc4c96caee9e5dfe6a (patch)
tree5bc2cf985ca62dc4f53294c945b9dc0f4e61653d /roundcubemail/program/steps/mail/func.inc
parent2596982f3d589b163f59fc6c4079b39a5f0cdd08 (diff)
Cache information about writeble address sources for performance reasons
git-svn-id: https://svn.roundcube.net/trunk@4904 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/mail/func.inc')
-rw-r--r--roundcubemail/program/steps/mail/func.inc7
1 files changed, 3 insertions, 4 deletions
diff --git a/roundcubemail/program/steps/mail/func.inc b/roundcubemail/program/steps/mail/func.inc
index e0504e658..14e9c7602 100644
--- a/roundcubemail/program/steps/mail/func.inc
+++ b/roundcubemail/program/steps/mail/func.inc
@@ -1237,7 +1237,6 @@ function rcmail_alter_html_link($matches)
function rcmail_address_string($input, $max=null, $linked=false, $addicon=null)
{
global $IMAP, $RCMAIL, $PRINT_MODE, $CONFIG;
- static $got_writable_abook = null;
$a_parts = $IMAP->decode_address_list($input);
@@ -1248,8 +1247,8 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null)
$j = 0;
$out = '';
- if ($addicon && $got_writable_abook === null && $books = $RCMAIL->get_address_sources(true)) {
- $got_writable_abook = true;
+ if ($addicon && !isset($_SESSION['writeable_abook'])) {
+ $_SESSION['writeable_abook'] = $RCMAIL->get_address_sources(true) ? true : false;
}
foreach ($a_parts as $part) {
@@ -1284,7 +1283,7 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null)
Q($name ? $name : $mailto));
}
- if ($addicon && $got_writable_abook) {
+ if ($addicon && $_SESSION['writeable_abook']) {
$address = html::span(null, $address . html::a(array(
'href' => "#add",
'onclick' => sprintf("return %s.command('add-contact','%s',this)", JS_OBJECT_NAME, urlencode($string)),