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

feat(contactsinteraction): allow users to disable contacts interaction addressbook #39372

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tcitworld
Copy link
Member

@tcitworld tcitworld commented Jul 13, 2023

This allows simple users to opt-out of the contacts interaction addressbook even if admins have the app installed.

Similar to how the birthday calendar works, the functionnality can be toggled in the user's settings or by doing a DELETE on the addressbook.

A new contacts personal section has been added to contain this new setting.

TODO

  • moar tests

Checklist

apps/contactsinteraction/lib/DAV/Plugin.php Fixed Show fixed Hide fixed
*
* @param Server $server
*/
public function initialize(Server $server) {

Check notice

Code scanning / Psalm

MissingReturnType Note

Method OCA\ContactsInteraction\DAV\Plugin::initialize does not have a return type, expecting void
@skjnldsv skjnldsv mentioned this pull request Nov 1, 2023
This was referenced Nov 6, 2023
This was referenced Nov 14, 2023
@blizzz blizzz modified the milestones: Nextcloud 28, Nextcloud 29 Nov 23, 2023
@HLFH
Copy link
Contributor

HLFH commented Feb 1, 2024

@tcitworld But what if I like this addressbook, and I only need to delete one contact from this addressbook. Let's say I have sent an email to a non-existent address, I get a bounce-back NDR email, and the non-existent contact goes into the "Recently contacted" addressbook, but because the email address is invalid, I want to delete it, while still enjoying the "Recently contacted" addressbook. This PR seems to solve only 50% of the current issue we have with this addressbook. I think deleting/disabling the whole addressbook does not address the described issue I have.

@tcitworld
Copy link
Member Author

@HLFH We will keep the issue opened for this specific aspect

@tcitworld tcitworld force-pushed the contctsinteraction-usersetting branch from c43c995 to b6710f4 Compare February 1, 2024 17:36
@tcitworld
Copy link
Member Author

Rebased

Copy link
Member

@st3iny st3iny left a comment

Choose a reason for hiding this comment

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

Deleting the address book from the Contacts app didn't work. The DELETE request itself worked and the address book vanishes until the next page reload. It will still contain all of its former contacts after the page reload.

Disabling it via the personal settings works. However, the address book is still shown in the Contacts settings modal (with 0 contacts and 0 groups) afterwards.

@tcitworld tcitworld added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Feb 13, 2024
@Altahrim Altahrim mentioned this pull request Mar 12, 2024
This was referenced Mar 14, 2024
@Altahrim Altahrim mentioned this pull request Mar 25, 2024
@skjnldsv skjnldsv mentioned this pull request Mar 28, 2024
81 tasks
@skjnldsv skjnldsv modified the milestones: Nextcloud 29, Nextcloud 30 Mar 28, 2024
@tcitworld tcitworld force-pushed the contctsinteraction-usersetting branch from b6710f4 to 529d2d9 Compare June 23, 2024 16:16
@tcitworld tcitworld added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jun 23, 2024
@tcitworld
Copy link
Member Author

Deleting the address book from the Contacts app didn't work. The DELETE request itself worked and the address book vanishes until the next page reload. It will still contain all of its former contacts after the page reload.
Disabling it via the personal settings works. However, the address book is still shown in the Contacts settings modal (with 0 contacts and 0 groups) afterwards.

Fixed this.

*/
class Plugin extends ServerPlugin {

protected Server $server;

Check notice

Code scanning / Psalm

PropertyNotSetInConstructor Note

Property OCA\ContactsInteraction\DAV\Plugin::$server is not defined in constructor of OCA\ContactsInteraction\DAV\Plugin or in any methods called in the constructor
@tcitworld tcitworld force-pushed the contctsinteraction-usersetting branch from 529d2d9 to fd59640 Compare June 26, 2024 14:50
return;
}

$enabled = $event->getConfigValue() === 'yes';

Check notice

Code scanning / Psalm

PossiblyUndefinedMethod Note

Method OCP\Config\BeforePreferenceDeletedEvent::getConfigValue does not exist
Copy link
Member Author

Choose a reason for hiding this comment

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

indeed 🙈

This was referenced Jul 30, 2024
This was referenced Aug 5, 2024
@skjnldsv skjnldsv mentioned this pull request Aug 13, 2024
@skjnldsv skjnldsv closed this Aug 14, 2024
@skjnldsv skjnldsv removed this from the Nextcloud 30 milestone Aug 14, 2024
@tcitworld tcitworld reopened this Aug 26, 2024
…n addressbook

This allows simple users to opt-out of the contacts interaction
addressbook even if admins have the app installed.

Similar to how the birthday calendar works, the functionnality can be
toggled in the user's settings or by doing a DELETE on the addressbook.

A new contacts personal section has been added to contain this new
setting.

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
@skjnldsv skjnldsv force-pushed the contctsinteraction-usersetting branch from fd59640 to d46271b Compare August 27, 2024 08:54
@skjnldsv skjnldsv added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing Work in progress feature: carddav Related to CardDAV internals feature: contacts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show/hide "recently contacted" Not possible to clear "Recently contacted" or delete contacts within it
6 participants