X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Facl_selectors.php;h=91f94155900adba71fbd74e3cb356340c2ea9465;hb=4bb9263e43ae522cc93644b2109b383c98ba4420;hp=31d074276ffe7c6f9f385f3a76885d485cfa1724;hpb=c8ecc3140534b4138db4eea415685f85bc56a5e0;p=friendica.git diff --git a/include/acl_selectors.php b/include/acl_selectors.php index 31d074276f..91f9415590 100644 --- a/include/acl_selectors.php +++ b/include/acl_selectors.php @@ -2,15 +2,18 @@ /** * @file include/acl_selectors.php */ + use Friendica\App; use Friendica\Content\Feature; use Friendica\Content\Widget; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; +use Friendica\Core\Protocol; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\GContact; +use Friendica\Util\Network; require_once "mod/proxy.php"; @@ -183,9 +186,6 @@ function contact_selector($selname, $selclass, $options, $preselected = false) function contact_select($selname, $selclass, $preselected = false, $size = 4, $privmail = false, $celeb = false, $privatenet = false, $tabindex = null) { - - require_once "include/bbcode.php"; - $a = get_app(); $o = ''; @@ -247,7 +247,7 @@ function contact_select($selname, $selclass, $preselected = false, $size = 4, $p } if ($privmail) { - $trimmed = GetProfileUsername($rr['url'], $rr['name'], false); + $trimmed = Protocol::formatMention($rr['url'], $rr['name']); } else { $trimmed = mb_substr($rr['name'],0,20); } @@ -357,8 +357,7 @@ function populate_acl($user = null, $show_jotnets = false) { Addon::callHooks('jot_networks', $jotnets); } else { - $jotnets .= sprintf(L10n::t('Connectors disabled, since "%s" is enabled.'), - L10n::t('Hide your profile details from unknown viewers?')); + $jotnets .= L10n::t('Connectors disabled, since "%s" is enabled.', L10n::t('Hide your profile details from unknown viewers?')); } } @@ -407,7 +406,7 @@ function acl_lookup(App $a, $out_type = 'json') $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)."%%'"; @@ -614,6 +613,14 @@ function acl_lookup(App $a, $out_type = 'json') $items = array_merge($groups, $contacts); + // At multi threaded posts the conv_id is not the parent of the whole thread + if ($conv_id > 0) { + $parent_item = dba::selectFirst('item', ['parent'], ['id' => $conv_id]); + if (DBM::is_result($parent_item)) { + $conv_id = $parent_item['parent']; + } + } + if ($conv_id) { /* * if $conv_id is set, get unknown contacts in thread @@ -714,7 +721,7 @@ function navbar_complete(App $a) { // check if searching in the local global contact table is enabled $localsearch = Config::get('system','poco_local_search'); - $search = $prefix.notags(trim($_REQUEST['search'])); + $search = notags(trim($_REQUEST['search'])); $mode = $_REQUEST['smode']; // don't search if search term has less than 2 characters @@ -734,7 +741,7 @@ function navbar_complete(App $a) { if (! $localsearch) { $p = (($a->pager['page'] != 1) ? '&p=' . $a->pager['page'] : ''); - $x = z_fetch_url(get_server() . '/lsearch?f=' . $p . '&search=' . urlencode($search)); + $x = Network::curl(get_server() . '/lsearch?f=' . $p . '&search=' . urlencode($search)); if ($x['success']) { $j = json_decode($x['body'],true); if ($j && isset($j['results'])) {