Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

display displayname on federated shares #35915

Merged
merged 1 commit into from
Jun 29, 2023

Conversation

ArtificialOwl
Copy link
Member

@ArtificialOwl ArtificialOwl commented Dec 29, 2022

retrieve data from lookup-server if available when displaying shares.
includes some caching

also needed:

210675677-e2c390ea-9936-40cc-93d3-78e0bb0674d6

210675676-1be333c9-e8ba-4d7b-a13b-017369ffcfcc

210675669-4bdc2059-c86a-488c-96a0-28be48695e2d

Comment on lines 423 to 456
try {
$slaveService = Server::get(\OCA\GlobalSiteSelector\Service\SlaveService::class);
} catch (ContainerExceptionInterface $e) {
\OC::$server->getLogger()->logException($e);
return [];
}

Check failure

Code scanning / Psalm

InvalidCatch

Class/interface Psr\Container\ContainerExceptionInterface cannot be caught
}

try {
$slaveService = Server::get(\OCA\GlobalSiteSelector\Service\SlaveService::class);

Check failure

Code scanning / Psalm

UndefinedClass

Class, interface or enum named OCA\GlobalSiteSelector\Service\SlaveService does not exist
try {
$slaveService = Server::get(\OCA\GlobalSiteSelector\Service\SlaveService::class);
} catch (ContainerExceptionInterface $e) {
\OC::$server->getLogger()->logException($e);

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OC\Server::getLogger has been marked as deprecated
try {
$slaveService = Server::get(\OCA\GlobalSiteSelector\Service\SlaveService::class);
} catch (ContainerExceptionInterface $e) {
\OC::$server->getLogger()->logException($e);

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OCP\ILogger::logException has been marked as deprecated
@szaimen szaimen added this to the Nextcloud 26 milestone Dec 29, 2022
@ArtificialOwl ArtificialOwl force-pushed the enh/noid/display-name-federated-shares branch from 0fbdea9 to 4e40b11 Compare January 4, 2023 09:51
Comment on lines 843 to 852
try {
$slaveService = Server::get(\OCA\GlobalSiteSelector\Service\SlaveService::class);
} catch (ContainerExceptionInterface $e) {
\OC::$server->getLogger()->logException($e);
return '';
}

Check failure

Code scanning / Psalm

InvalidCatch

Class/interface Psr\Container\ContainerExceptionInterface cannot be caught
@@ -335,13 +340,13 @@
return $result;
}

private function notifyAboutNewShare($shareWith, $shareId, $ownerFederatedId, $sharedByFederatedId, $name): void {
private function notifyAboutNewShare($shareWith, $shareId, $ownerFederatedId, $sharedByFederatedId, $name, $displayName): void {

Check notice

Code scanning / Psalm

MissingParamType

Parameter $shareWith has no provided type
@@ -335,13 +340,13 @@
return $result;
}

private function notifyAboutNewShare($shareWith, $shareId, $ownerFederatedId, $sharedByFederatedId, $name): void {
private function notifyAboutNewShare($shareWith, $shareId, $ownerFederatedId, $sharedByFederatedId, $name, $displayName): void {

Check notice

Code scanning / Psalm

MissingParamType

Parameter $shareId has no provided type
@@ -335,13 +340,13 @@
return $result;
}

private function notifyAboutNewShare($shareWith, $shareId, $ownerFederatedId, $sharedByFederatedId, $name): void {
private function notifyAboutNewShare($shareWith, $shareId, $ownerFederatedId, $sharedByFederatedId, $name, $displayName): void {

Check notice

Code scanning / Psalm

MissingParamType

Parameter $ownerFederatedId has no provided type
@@ -335,13 +340,13 @@
return $result;
}

private function notifyAboutNewShare($shareWith, $shareId, $ownerFederatedId, $sharedByFederatedId, $name): void {
private function notifyAboutNewShare($shareWith, $shareId, $ownerFederatedId, $sharedByFederatedId, $name, $displayName): void {

Check notice

Code scanning / Psalm

MissingParamType

Parameter $sharedByFederatedId has no provided type
@@ -335,13 +340,13 @@
return $result;
}

private function notifyAboutNewShare($shareWith, $shareId, $ownerFederatedId, $sharedByFederatedId, $name): void {
private function notifyAboutNewShare($shareWith, $shareId, $ownerFederatedId, $sharedByFederatedId, $name, $displayName): void {

Check notice

Code scanning / Psalm

MissingParamType

Parameter $name has no provided type
@@ -335,13 +340,13 @@
return $result;
}

private function notifyAboutNewShare($shareWith, $shareId, $ownerFederatedId, $sharedByFederatedId, $name): void {
private function notifyAboutNewShare($shareWith, $shareId, $ownerFederatedId, $sharedByFederatedId, $name, $displayName): void {

Check notice

Code scanning / Psalm

MissingParamType

Parameter $displayName has no provided type
@ArtificialOwl ArtificialOwl force-pushed the enh/noid/display-name-federated-shares branch from 4e40b11 to 9e1914c Compare January 26, 2023 16:22
@ArtificialOwl ArtificialOwl force-pushed the enh/noid/display-name-federated-shares branch from 819cecf to efdc115 Compare January 26, 2023 20:44
@ArtificialOwl ArtificialOwl force-pushed the enh/noid/display-name-federated-shares branch 4 times, most recently from 3c5e09f to 6631ea2 Compare January 30, 2023 18:16
'strict_search' => true,
]);
try {
$result = \OC::$server->getContactsManager()->search($query, [$property], [

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OC\Server::getContactsManager has been marked as deprecated
@ArtificialOwl ArtificialOwl force-pushed the enh/noid/display-name-federated-shares branch 3 times, most recently from bb00928 to 2532553 Compare February 1, 2023 09:28
@ArtificialOwl ArtificialOwl added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Feb 1, 2023
@ArtificialOwl ArtificialOwl requested review from a team, icewind1991, blizzz and come-nc and removed request for a team February 1, 2023 12:15
@blizzz blizzz mentioned this pull request Feb 1, 2023
@@ -335,13 +341,13 @@ private function mapShareTypeToNextcloud($shareType) {
return $result;
}

private function notifyAboutNewShare($shareWith, $shareId, $ownerFederatedId, $sharedByFederatedId, $name): void {
private function notifyAboutNewShare($shareWith, $shareId, $ownerFederatedId, $sharedByFederatedId, $name, $displayName): void {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
private function notifyAboutNewShare($shareWith, $shareId, $ownerFederatedId, $sharedByFederatedId, $name, $displayName): void {
private function notifyAboutNewShare($shareWith, $shareId, $ownerFederatedId, $sharedByFederatedId, $name, string $displayName): void {

And might as well type all parameters, this is a private function.

@@ -360,6 +376,102 @@ private function getDisplayNameFromAddressBook(string $query, string $property):
return $query;
}


/**
Copy link
Member Author

Choose a reason for hiding this comment

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

add some comment on how this method works ...

@skjnldsv skjnldsv mentioned this pull request Feb 23, 2023
@blizzz blizzz mentioned this pull request Mar 7, 2023
@ArtificialOwl ArtificialOwl force-pushed the enh/noid/display-name-federated-shares branch from f5449ea to c606739 Compare April 18, 2023 11:48
@blizzz
Copy link
Member

blizzz commented Apr 20, 2023

what's with all the psalm warnings?

@ArtificialOwl ArtificialOwl force-pushed the enh/noid/display-name-federated-shares branch from c606739 to 60f9cf0 Compare April 22, 2023 11:16
@ArtificialOwl ArtificialOwl force-pushed the enh/noid/display-name-federated-shares branch 2 times, most recently from bcaef17 to 2e69ffa Compare April 23, 2023 12:24
@blizzz blizzz mentioned this pull request May 17, 2023
@blizzz blizzz modified the milestones: Nextcloud 27, Nextcloud 28 May 23, 2023
@ArtificialOwl ArtificialOwl force-pushed the enh/noid/display-name-federated-shares branch from 2e69ffa to b5562ab Compare June 27, 2023 14:38
@ArtificialOwl ArtificialOwl force-pushed the enh/noid/display-name-federated-shares branch from b5562ab to 415d824 Compare June 27, 2023 14:52
Signed-off-by: Maxence Lange <[email protected]>
@ArtificialOwl ArtificialOwl force-pushed the enh/noid/display-name-federated-shares branch from 415d824 to d2efd0e Compare June 28, 2023 10:28
@ArtificialOwl
Copy link
Member Author

/backport to stable27

@ArtificialOwl
Copy link
Member Author

/backport to stable26

@blizzz blizzz merged commit 7b7148c into master Jun 29, 2023
@blizzz blizzz deleted the enh/noid/display-name-federated-shares branch June 29, 2023 12:40
@backportbot-nextcloud
Copy link

The backport to stable27 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable27
git pull origin stable27

# Create the new backport branch
git checkout -b fix/foo-stable27

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123

# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable27

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

@backportbot-nextcloud
Copy link

The backport to stable26 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable26
git pull origin stable26

# Create the new backport branch
git checkout -b fix/foo-stable26

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123

# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable26

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

@AndyScherzinger
Copy link
Member

@ArtificialOwl can you take care of the manual backports? 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants