Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions apps/files_sharing/lib/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ public function getCapabilities() {
'expire_date' => ['enabled' => true]
];

// Sharee searches
$res['sharee'] = [
'query_lookup_default' => $this->config->getSystemValueBool('gs.enabled', false)
];

return [
'files_sharing' => $res,
];
Expand Down
9 changes: 8 additions & 1 deletion apps/files_sharing/lib/Controller/ShareesAPIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,21 @@ public function search(string $search = '', string $itemType = null, int $page =
$this->limit = (int) $perPage;
$this->offset = $perPage * ($page - 1);

// In global scale mode we always search the loogup server
if ($this->config->getSystemValueBool('gs.enabled', false)) {
$lookup = true;
$this->result['lookupEnabled'] = true;
} else {
$this->result['lookupEnabled'] = $this->config->getAppValue('files_sharing', 'lookupServerEnabled', 'yes') === 'yes';
}

list($result, $hasMoreResults) = $this->collaboratorSearch->search($search, $shareTypes, $lookup, $this->limit, $this->offset);

// extra treatment for 'exact' subarray, with a single merge expected keys might be lost
if(isset($result['exact'])) {
$result['exact'] = array_merge($this->result['exact'], $result['exact']);
}
$this->result = array_merge($this->result, $result);
$this->result['lookupEnabled'] = $this->config->getAppValue('files_sharing', 'lookupServerEnabled', 'yes') === 'yes';
$response = new DataResponse($this->result);

if ($hasMoreResults) {
Expand Down
8 changes: 8 additions & 0 deletions core/js/sharedialogview.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@
var deferred = $.Deferred();
var view = this;

// query lookup GS by default if enabled
var capabilities = OC.getCapabilities()
if (capabilities.files_sharing
&& capabilities.files_sharing.sharee
&& capabilities.files_sharing.sharee.query_lookup_default) {
this._lookup = true;
}

$.get(
OC.linkToOCS('apps/files_sharing/api/v1') + 'sharees',
{
Expand Down