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

vCard FN property not updated when modifying contact details #1761

Closed
mstolf opened this issue Sep 18, 2024 · 4 comments
Closed

vCard FN property not updated when modifying contact details #1761

mstolf opened this issue Sep 18, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@mstolf
Copy link

mstolf commented Sep 18, 2024

Describe the bug
When updating a contact's information (name and surname), the changes are reflected correctly in the database fields first_name and last_name, but the vCard property associated with the contact is not updated accordingly. This leads to inconsistencies between the database and the vCard data.

To Reproduce
Steps to reproduce the behavior:

  1. Update a contact’s first name or last name.
  2. Check the database, and confirm that the first_name and last_name fields are updated.
  3. Check the vCard property – it remains unchanged.

Expected behavior
When updating contact details (e.g., name or surname), the vCard property should be updated to reflect the changes.

Screenshots
If applicable, add screenshots to help explain your problem.

Please complete the following information:

  • Browser: Chrome 129.0.6668.59 (Version oficial) 64 bits
  • IMAP daemon: Dovecot
  • PHP version: 8.3
  • SnappyMail Version: 2.36.1
  • Mode: Nextcloud

Debug/logging information
Read here how to log
Here is the payload sent when updating the contact. In this case, I updated the contact from "Nome" to "Nome 2". It can be seen that the N property was updated, but the FN property was not:

{"uid":"11","jCard":"[\"vcard\",[[\"version\",{},\"text\",\"4.0\"],[\"n\",{},\"text\",[\"\",\"Nome 2\",\"\",\"\",\"\"]],[\"org\",[],\"text\",[\"\",\"\"]],[\"x-crypto\",{\"allowed\":\"PGP/INLINE,PGP/MIME,S/MIME,S/MIMEOpaque\",\"signpref\":\"Ask\",\"encryptpref\":\"Ask\"},\"x-crypto\",\"\"],[\"rev\",[],\"timestamp\",\"2024-09-18T13:59:44Z\"],[\"uid\",[],\"text\",\"0b99ea2e-9e37-4619-b41d-21dd1770746e\"],[\"fn\",[],\"text\",\"Nome\"],[\"prodid\",[],\"text\",\"SnappyMail-2.36.1\"]]]","showToast":true,"Action":"ContactSave"}

@the-djmaze the-djmaze added the enhancement New feature or request label Sep 18, 2024
@the-djmaze the-djmaze changed the title Issue with vCard property update when modifying contact details Issue with vCard FN property update when modifying contact details Sep 18, 2024
@the-djmaze
Copy link
Owner

the-djmaze commented Sep 18, 2024

Correct. Currently the code to update FN is disabled.

// jCard.parseFullName({set:true});

This is because N consists of 5 fields, and below i show which SnappyMail currently can edit:

  • surName
  • givenName
  • middleName
  • namePrefix
  • nameSuffix

So when all 5 can be edited the FN can be activated.

@the-djmaze the-djmaze changed the title Issue with vCard FN property update when modifying contact details vCard FN property not updated when modifying contact details Sep 18, 2024
@mstolf
Copy link
Author

mstolf commented Sep 19, 2024

OK, I'm interested in developing this fix

So to update the FN property we will need to:

  • Add the fields middle name, first name prefix, and first name suffix to the Contacts screen
  • Then enable jCard.parseFullName

Should I create a record for each of these properties? If yes, which one to use for each of them?

@the-djmaze
Copy link
Owner

the-djmaze commented Sep 20, 2024

There's no need to modify the database.
SnappyMail only uses the old database fields for old RainLoop code.

Maybe just enable the following to get it working

<!--
<div class="property-line" data-i18n="[title]CONTACTS/PLACEHOLDER_ENTER_MIDDLE_NAME">
<span data-bind="text: middleName"></span>
<input type="text"
autocomplete="off" autocorrect="off" autocapitalize="off"
data-bind="textInput: middleName" data-i18n="[placeholder]CONTACTS/PLACEHOLDER_ENTER_MIDDLE_NAME">
</div>
<div class="property-line" data-i18n="[title]CONTACTS/PLACEHOLDER_ENTER_NAME_PREFIX">
<span data-bind="text: namePrefix"></span>
<input type="text"
autocomplete="off" autocorrect="off" autocapitalize="off"
data-bind="textInput: namePrefix" data-i18n="[placeholder]CONTACTS/PLACEHOLDER_ENTER_NAME_PREFIX">
</div>
<div class="property-line" data-i18n="[title]CONTACTS/PLACEHOLDER_ENTER_NAME_SUFFIX">
<span data-bind="text: nameSuffix"></span>
<input type="text"
autocomplete="off" autocorrect="off" autocapitalize="off"
data-bind="textInput: nameSuffix" data-i18n="[placeholder]CONTACTS/PLACEHOLDER_ENTER_NAME_SUFFIX">
</div>
-->

@mstolf
Copy link
Author

mstolf commented Sep 30, 2024

Could you please reopen this issue? I am submitting a pull request to fix the translations of the fields added for the pt-BR language.

@the-djmaze the-djmaze reopened this Oct 1, 2024
@mstolf mstolf closed this as completed Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants