dont show remote and email options if we have an exact match for local user email#16035
dont show remote and email options if we have an exact match for local user email#16035
Conversation
|
imo, if a local user with a given email exists than it's highly unlikely that that email is also a fed share target that the user wants to share with. It already hides the fed. share option if the email is found in the user's address book |
Fair enough. Didn't know that
Tricky to assume things like that. But I'm not going to open a general discussion about this. So let's go for your solution. |
|
I just tested again and for email addresses with exact match this is already the case since 15 at least. See also #15665 (comment) |
|
Those are the tests that fail: server/tests/lib/Collaboration/Collaborators/UserPluginTest.php Lines 244 to 358 in 03f1fef All of them do things like this: as the user results instead of Thus I have no idea what the initial thoughts where behind this. They are coming from somewhere here: https://github.com/nextcloud/server/blame/dd9e191d373217b2a07e4ac5b2cc294c0a6227a1/apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php#L1272 @nickvergessen @icewind1991 Any idea how to "fix" them? |
|
Seems like the tests where just not updated. It should return getUserMocks there as well. |
| $usersTmp = $this->groupManager->displayNamesInGroup($userGroup, $search, $limit, $offset); | ||
| foreach ($usersTmp as $uid => $userDisplayName) { | ||
| $users[$uid] = $userDisplayName; | ||
| $users[$uid] = $this->userManager->get($uid); |
There was a problem hiding this comment.
This needs adjustments in the tests.
It returns tons of null which of course later on dont have a getDisplayName() function, etc.
|
Bump? |
7d8a41f to
55b78fc
Compare
|
Rebased and fixed the tests. |
55b78fc to
a4dae72
Compare
|
another rebase, as some failing tests are fixed on master meanwhile |
a4dae72 to
b7b80a7
Compare
…l user email Signed-off-by: Robin Appelman <robin@icewind.nl>
b7b80a7 to
01c147a
Compare
|
rebased and fixed tests |
|
Integration tests are broken |
|
@danxuliu can you have a look, I'm really not familiar with the integration tests :( |
The sharees integration test failures are legit. The problem is that now |
|
Yep, needed for 18! |
|
backport to stable18 in #20574 |
|
This breaks searching for users by displaynames when |
|
unfortunately this doesn't work if the mail address is pasted with preceding or following whitespace(s). |




Signed-off-by: Robin Appelman robin@icewind.nl