use Friendica\App;
use Friendica\Content\Widget;
-use Friendica\Core\Acl;
+use Friendica\Core\ACL;
use Friendica\Core\Addon;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
$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) . "%%'";
$search = notags(trim($_REQUEST['search']));
$mode = $_REQUEST['smode'];
- $r = Acl::contactAutocomplete($search, $mode);
+ $r = ACL::contactAutocomplete($search, $mode);
$contacts = [];
foreach ($r as $g) {
$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