diff --git a/plugins/libkolab/lib/kolab_format_configuration.php b/plugins/libkolab/lib/kolab_format_configuration.php index 17b46a70..4506ed3c 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 e04ccd68..22fb90c3 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