// Ensure that we do have a contact entry
Contact::getIdForURL($user_data['url'] ?? '');
- $contactDetails = Contact::getDetailsByURL($user_data['url'] ?? '', local_user());
+ $contactDetails = Contact::getByURLForUser($user_data['url'] ?? '', local_user(), [], false);
$result = new ContactResult(
$user_data['name'] ?? '',
/**
* Search in the global directory for occurrences of the search string
*
- * @see https://github.com/friendica/friendica-directory/blob/master/docs/Protocol.md#search
+ * @see https://github.com/friendica/friendica-directory/blob/stable/docs/Protocol.md#search
*
* @param string $search
* @param int $type specific type of searching
$profiles = $results['profiles'] ?? [];
foreach ($profiles as $profile) {
- $profile_url = $profile['profile_url'] ?? '';
- $contactDetails = Contact::getDetailsByURL($profile_url, local_user());
+ $profile_url = $profile['url'] ?? '';
+ $contactDetails = Contact::getByURLForUser($profile_url, local_user(), [], false);
$result = new ContactResult(
$profile['name'] ?? '',
continue;
}
- $contact = Contact::getDetailsByURL($row["nurl"], local_user());
+ $contact = Contact::getByURLForUser($row["nurl"], local_user(), [], false);
if ($contact["name"] == "") {
$contact["name"] = end(explode("/", $urlParts["path"]));
{
return DI::config()->get('system', 'directory', self::DEFAULT_DIRECTORY);
}
+
+ /**
+ * Return the search path (either fulltext search or tag search)
+ *
+ * @param string $search
+ * @return string search path
+ */
+ public static function getSearchPath(string $search)
+ {
+ if (substr($search, 0, 1) == '#') {
+ return 'search?tag=' . urlencode(substr($search, 1));
+ } else {
+ return 'search?q=' . urlencode($search);
+ }
+ }
}