summaryrefslogtreecommitdiff
path: root/plugins/libkolab
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-10-13 12:48:59 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2014-10-13 12:48:59 (GMT)
commit6f0ef60f7a15162bdb7052c73bbb2fd515ae773c (patch)
treef7a9aea5f9a95d05e12e327d0477a621c70eb21e /plugins/libkolab
parent63b69871fee37777f03e17a916501f1e13f3f028 (diff)
downloadroundcubemail-plugins-kolab-6f0ef60f7a15162bdb7052c73bbb2fd515ae773c.tar.gz
Add fall-back to the full uri for searching relations in cache
Diffstat (limited to 'plugins/libkolab')
-rw-r--r--plugins/libkolab/lib/kolab_format_configuration.php4
-rw-r--r--plugins/libkolab/lib/kolab_storage_config.php12
2 files changed, 14 insertions, 2 deletions
diff --git a/plugins/libkolab/lib/kolab_format_configuration.php b/plugins/libkolab/lib/kolab_format_configuration.php
index 17b46a7..4506ed3 100644
--- a/plugins/libkolab/lib/kolab_format_configuration.php
+++ b/plugins/libkolab/lib/kolab_format_configuration.php
@@ -241,6 +241,10 @@ class kolab_format_configuration extends kolab_format
else if (!empty($member['params']['message-id'])) {
$words[] = $member['params']['message-id'];
}
+ else {
+ // derive message identifier from URI
+ $words[] = md5($url);
+ }
}
return $words;
diff --git a/plugins/libkolab/lib/kolab_storage_config.php b/plugins/libkolab/lib/kolab_storage_config.php
index e04ccd6..22fb90c 100644
--- a/plugins/libkolab/lib/kolab_storage_config.php
+++ b/plugins/libkolab/lib/kolab_storage_config.php
@@ -351,6 +351,8 @@ class kolab_storage_config
'params' => $params,
);
}
+
+ return false;
}
/**
@@ -765,10 +767,16 @@ class kolab_storage_config
$filter = array(
array('type', '=', 'relation'),
array('category', '=', 'generic'),
- // @TODO: what if Message-Id (and Date) does not exist?
- array('member', '=', $message->get('message-id', false)),
);
+ // query by message-id
+ $member_id = $message->get('message-id', false);
+ if (empty($member_id)) {
+ // derive message identifier from URI
+ $member_id = md5($uri);
+ }
+ array('member', '=', $member_id);
+
// get UIDs of assigned notes
foreach ($this->get_objects($filter, $default) as $relation) {
// we don't need to update members if the URI is found