-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
feat(dav): expose Nextcloud groups to Contact's system addressbook contacts #40997
base: master
Are you sure you want to change the base?
feat(dav): expose Nextcloud groups to Contact's system addressbook contacts #40997
Conversation
3ff1d95
to
bd16299
Compare
} | ||
|
||
public function handle(Event $event): void { | ||
if (!($event instanceof UserUpdatedEvent || $event instanceof UserAddedEvent || $event instanceof UserRemovedEvent)) { |
Check notice
Code scanning / Psalm
DocblockTypeContradiction Note
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Data exposure of groups others are members of needs to be discussed/approved first: #38432
89b158d
to
ef01811
Compare
…ntacts And move event listeners related to SyncService to proper ones Note: Changes to user system addressbook cards are now always done in a QueuedJob Closes #38432 Signed-off-by: Thomas Citharel <[email protected]>
Signed-off-by: Thomas Citharel <[email protected]>
ef01811
to
7d6fdda
Compare
$groupsToInclude = explode(',', $this->config->getAppValue(Application::APP_ID, 'system_addressbook_groups_to_include', '')); | ||
$groupsToIgnore = explode(',', $this->config->getAppValue(Application::APP_ID, 'system_addressbook_groups_to_ignore', '')); | ||
$groupNames = array_reduce($this->groupManager->getUserGroups($user), function ($groupNames, IGroup $group) use ($groupsToInclude, $groupsToIgnore) { | ||
if (!in_array($group->getGID(), $groupsToIgnore, true) && (empty($groupsToInclude) || in_array($group->getGID(), $groupsToInclude, true))) { |
Check notice
Code scanning / Psalm
DocblockTypeContradiction Note
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 if this is an opt-in feature
Code looks clean ✨
if ($this->config->getAppValue(Application::APP_ID, 'system_addressbook_expose_groups', 'no') === 'yes') { | ||
$groupsToInclude = explode(',', $this->config->getAppValue(Application::APP_ID, 'system_addressbook_groups_to_include', '')); | ||
$groupsToIgnore = explode(',', $this->config->getAppValue(Application::APP_ID, 'system_addressbook_groups_to_ignore', '')); | ||
$groupNames = array_reduce($this->groupManager->getUserGroups($user), function ($groupNames, IGroup $group) use ($groupsToInclude, $groupsToIgnore) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be wrong but this could be a use case for https://www.php.net/manual/en/function.array-intersect.php
declare(strict_types=1); | ||
|
||
/** | ||
* @copyright 2022 Thomas Citharel <[email protected]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you wait a little longer you can skip setting your IDE to 2023
Conflicts :( |
Closes #38432
And move event listeners related to SyncService to proper ones
Note: Changes to user system addressbook cards are now always done in a QueuedJob
TODO
admin
Checklist