Uh oh!
There was an error while loading. Please reload this page.
Use contacts name on federated activities - #19173
Merged
rullzer merged 3 commits intoMar 10, 2020
Merged
Conversation
nickvergessen
commented
Jan 28, 2020
MemberAuthor
/backport to stable18 |
blizzz
approved these changes
Jan 29, 2020
| $addressBookContacts = $this->contactsManager->search($search, ['CLOUD']); | ||
| foreach ($addressBookContacts as $contact) { | ||
| if (isset($contact['isLocalSystemBook'])) { |
MemberAuthor
There was a problem hiding this comment.
I copied this from the RemotePlugin I think
Comment on lines
+172
to
198
| // First try local user | ||
| $user = $this->userManager->get($uid); | ||
| if ($user instanceof IUser) { | ||
| return [ | ||
| 'type' => 'user', | ||
| 'id' => $user->getUID(), | ||
| 'name' => $user->getDisplayName(), | ||
| ]; | ||
| } | ||
| // Then a contact from the addressbook | ||
| if ($this->cloudIdManager->isValidCloudId($uid)) { | ||
| $cloudId = $this->cloudIdManager->resolveCloudId($uid); | ||
| return [ | ||
| 'type' => 'user', | ||
| 'id' => $cloudId->getUser(), | ||
| 'name' => $this->getDisplayNameFromAddressBook($cloudId->getDisplayId()), | ||
| 'server' => $cloudId->getRemote(), | ||
| ]; | ||
| } | ||
| // Fallback to empty dummy data | ||
| return [ | ||
| 'type' => 'user', | ||
| 'id' => $uid, | ||
| 'name' => $this->displayNames[$uid], | ||
| 'name' => $uid, | ||
| ]; |
Member
There was a problem hiding this comment.
since it's duplicated, perhaps it is worth to but it into a reusable trait (not necessarily in this PR)
MemberAuthor
There was a problem hiding this comment.
Well yes and no, I think apps should work on their own. And so we would have to put the traits into the public API :/
Member
There was a problem hiding this comment.
yes, that's a bit tricky, i agree. We can have an empty trait that is implementing a private one, to some degree. Then it looks generic enough be worth having it.
| } | ||
| } | ||
| return $search; |
rullzer
commented
Feb 7, 2020
Member
CI is not happy... |
nickvergessenforce-pushed
the
bugfix/noid/fix-displayname-of-contacts-in-remote-activities
branch
from
February 7, 2020 09:52
ec3d7c6 to
dbe1b92Comparenickvergessen
commented
Feb 7, 2020
MemberAuthor
Fixed |
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
rullzerforce-pushed
the
bugfix/noid/fix-displayname-of-contacts-in-remote-activities
branch
from
March 10, 2020 18:37
dbe1b92 to
85153e8Comparerullzer
deleted the
bugfix/noid/fix-displayname-of-contacts-in-remote-activities
branch
March 10, 2020 19:30
backport to stable18 in #19879 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Joas Schilling coding@schilljs.com