From 83c4c86251a0d803a55f42d5933f52c571bff5a4 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 12 Mar 2018 08:15:59 -0400 Subject: [PATCH 1/2] Fix: The acl lookup now works in multi threaded posts as well --- mod/acl.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mod/acl.php b/mod/acl.php index 11d9e5683..817a02655 100644 --- a/mod/acl.php +++ b/mod/acl.php @@ -32,7 +32,7 @@ function acl_content(App $a) $search = $_REQUEST['query']; } - logger('Searching for ' . $search . ' - type ' . $type, LOGGER_DEBUG); + logger("Searching for ".$search." - type ".$type." conversation ".$conv_id, LOGGER_DEBUG); if ($search != '') { $sql_extra = "AND `name` LIKE '%%" . dbesc($search) . "%%'"; @@ -239,6 +239,12 @@ function acl_content(App $a) $items = array_merge($groups, $contacts); if ($conv_id) { + // In multi threaded posts the conv_id is not the parent of the whole thread + $parent_item = dba::selectFirst('item', ['parent'], ['id' => $conv_id]); + if (DBM::is_result($parent_item)) { + $conv_id = $parent_item['parent']; + } + /* * if $conv_id is set, get unknown contacts in thread * but first get known contacts url to filter them out From 30d8c736602e8a0e485e71fbe4ac9b9f762065bb Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 16 Mar 2018 21:57:58 -0400 Subject: [PATCH 2/2] Add missing Cache::delete method --- src/Core/Cache.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/Core/Cache.php b/src/Core/Cache.php index 3f2edd2e2..f1d1e11a5 100644 --- a/src/Core/Cache.php +++ b/src/Core/Cache.php @@ -99,6 +99,24 @@ class Cache extends \Friendica\BaseObject return $return; } + /** + * @brief Delete a value from the cache + * + * @param string $key The key to the cached data + * + * @return bool + */ + public static function delete($key) + { + $time = microtime(true); + + $return = self::getDriver()->delete($key); + + self::getApp()->save_timestamp($time, 'cache_write'); + + return $return; + } + /** * @brief Remove outdated data from the cache *