Skip to content

Conversation

@schiessle
Copy link
Member

backport of #11714

Signed-off-by: Bjoern Schiessle <[email protected]>
$body = json_decode($response->getBody(), true);

foreach ($body as $lookup) {
$remote = $this->cloudIdManager->resolveCloudId($lookup['federationId'])->getRemote();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolveCloudId can throw, better wrap this in a try-catch too, so we get as many suggestions as possible?


foreach ($body as $lookup) {
$remote = $this->cloudIdManager->resolveCloudId($lookup['federationId'])->getRemote();
if ($this->currentUserRemote === $remote) continue;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline+ brackets please

foreach ($body as $lookup) {
$remote = $this->cloudIdManager->resolveCloudId($lookup['federationId'])->getRemote();
if ($this->currentUserRemote === $remote) continue;
$name = isset($lookup['name']['value']) ? $lookup['name']['value'] : '';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are now in php 7+ you can use:

$name = $lookup['name']['value'] ?? '';

Signed-off-by: Bjoern Schiessle <[email protected]>
@blizzz
Copy link
Member

blizzz commented Oct 12, 2018

let's finish master first?

@MorrisJobke
Copy link
Member

let's finish master first?

Yes - let's close this for now and do the backport PR once master is accepted.

@MorrisJobke MorrisJobke deleted the lookupserver-and-global-scale-stable14 branch October 12, 2018 09:23
@MorrisJobke MorrisJobke removed this from the Nextcloud 14.0.4 milestone Oct 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants