Skip to content

Commit

Permalink
WIP: Add local share if remote cloud id matches a local user ones
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Oct 23, 2018
1 parent 4786e00 commit 8a57415
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/private/Collaboration/Collaborators/RemotePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,18 @@ public function search($search, $limit, $offset, ISearchResult $searchResult) {

// TODO: inject
$localUser = \OC::$server->getUserManager()->get($remoteUser);
if ($localUser !== null && $cloudId === $localUser->getCloudId()) {
continue;
/**
* Add local share if remote cloud id matches a local user ones
*/
if ($localUser !== null && $remoteUser !== $this->userId && $cloudId === $localUser->getCloudId() ) {
$result['wide'][] = [
'label' => $contact['FN'],
'uuid' => $contact['UID'],
'value' => [
'shareType' => Share::SHARE_TYPE_USER,
'shareWith' => $remoteUser
]
];
}

if (strtolower($contact['FN']) === $lowerSearch || strtolower($cloudId) === $lowerSearch) {
Expand Down

0 comments on commit 8a57415

Please sign in to comment.