Closed Bug 879435 Opened 11 years ago Closed 11 years ago

my vCard forgets values (preferred email format and jabber id)

Categories

(MailNews Core :: Address Book, defect)

x86
Linux
defect
Not set
minor

Tracking

(Not tracked)

VERIFIED FIXED
Thunderbird 24.0

People

(Reporter: justus.seifert, Assigned: aceman)

Details

Attachments

(2 files, 1 obsolete file)

User Agent: Mozilla/5.0 (X11; Linux i686; rv:21.0) Gecko/20100101 Firefox/21.0 (Beta/Release)
Build ID: 20130514164240

Steps to reproduce:

I opened my vCard in the Accounts settings and changed the value of "Prefers to receive messages fomated as:" and "Jabber ID:". I clicked ok and after that opened the vcard editor again. 


Actual results:

My settings were not present. In fact the drop down for the format did not show any viable option but instead was resized to a very flat slab without text.  the Jabber ID


Expected results:

The drop down menu should have showed text with my selection from earlier and the field for the jabber id should have contained the jabber id I entered.
Severity: normal → minor
Component: Preferences → Account Manager
Confirming and taking.
Assignee: nobody → acelists
Status: UNCONFIRMED → NEW
Ever confirmed: true
Product: Thunderbird → MailNews Core
"Prefers to receive messages fomated as:" shouldn't actually be displayed on the Vcard - that's a Thunderbird address book specific thing and there's nothing in vcard that would let that be recorded (or even interpreted at the other end).

Jabber id & other instant messaging ids there might be, but we'd need to check the vcard 2.1 spec (which we vaguely implement), and then see if we can implement support for those fields.
Thanks for the hints.
I have not found any mention of IM/chat nicks in the spec at http://www.imc.org/pdi/vcard-21.txt .

So I try to hide the mentioned unsupported fields.
Component: Account Manager → Address Book
@aceman: thank you.  one thing to note: thunderbird supports the preferred mail format in .vcf files through an extension.  i dont know if this is legit in vcf but it might work.  the string in the file looks like this: 
x-mozilla-html:FALSE
Yes, that is true. And the bug is that we need to convert from FALSE/TRUE to values of 1 or 2 for the dropdown.

Justus, have you tried that other Thunderbird can receive this setting from a sent vCard and use it properly? If yes, we could keep it in.

Standard8, could we keep the field in as it is clearly marked as an extension? I have tested that the field (x-mozilla-html) is stored in the vcard in prefs.js. we just fail to show it in the dialog at later read attempt.
Flags: needinfo?(mbanner)
> Product/Component: MailNews Core :: Address Book

Hmm, I thought that vCard is kept in nsIMsgIdentity, hence Account Management?
before i test weather thunderbird can receive proper data from this extension in vcards i would like to request that a similar extension for xmpp is added.  something like this:
x-mozilla-xmppid:example@example.com
Ok thunderbird seems to understand its own vcf extension:  when i opened the vcard i was shown the same messed up drop down menu.
it appears all that is missing is indeed the conversion to the correct values for display.
Flags: needinfo?(mbanner)
(In reply to Justus Seifert from comment #7)
> before i test weather thunderbird can receive proper data from this
> extension in vcards i would like to request that a similar extension for
> xmpp is added.  something like this:
> x-mozilla-xmppid:example@example.com

Please file this as a new enhancement request bug.

In this bug I hide the chat fields so that it does not look like we support them already.
Attached patch patch (obsolete) — Splinter Review
So I hide the Chat fields but preserve the "prefers HTML" dropdown, just decode it properly. I also added Seamonkey version but as I could not test it I don't know whether it is needed.
Attachment #758778 - Flags: review?(mbanner)
Attachment #758778 - Flags: review?(iann_bugzilla)
Status: NEW → ASSIGNED
Comment on attachment 758778 [details] [diff] [review]
patch

Review of attachment 758778 [details] [diff] [review]:
-----------------------------------------------------------------

::: mail/components/addrbook/content/abCardOverlay.js
@@ +499,5 @@
>    var popup = document.getElementById("PreferMailFormatPopup");
> +  if (popup) {
> +    let format = cardproperty.getProperty("PreferMailFormat", "");
> +    popup.value =
> +      (format == "TRUE") ? Components.interfaces.nsIAbPreferMailFormat.html : (

This is the wrong place to do this conversion, as it means that we'll potentially have nsAbCardProperty objects in the system with two types of value for the nsIAbPreferMailFormat.

I think this conversion should be done somewhere around http://hg.mozilla.org/comm-central/annotate/0c54a5703d29/mailnews/addrbook/src/nsAbManager.cpp#l1120 in the AB itself.

@@ +537,5 @@
>  // by vCard so the user does not try to edit them.
>  function HideNonVcardFields()
>  {
>    document.getElementById("homeTabButton").hidden = true;
> +  document.getElementById("chatTabButton").hidden = true;

Just to note, this is fine. As you mentioned, handling the other extensions for the ids should be done in a different bug.
Attachment #758778 - Flags: review?(mbanner) → review-
Thanks. So invert the logic from http://hg.mozilla.org/comm-central/file/3c7cb0989fef/mailnews/addrbook/src/nsAbCardProperty.cpp#l512, where only kPreferMailFormatProperty is handled as Uint32, others are String.
convertNameValue() is missing this special casing of kPreferMailFormatProperty.
Attached patch patch v2Splinter Review
OK, seems to work.
Attachment #758778 - Attachment is obsolete: true
Attachment #758778 - Flags: review?(iann_bugzilla)
Attachment #760591 - Flags: review?(mbanner)
Comment on attachment 760591 [details] [diff] [review]
patch v2

Review of attachment 760591 [details] [diff] [review]:
-----------------------------------------------------------------

Looks great.
Attachment #760591 - Flags: review?(mbanner) → review+
https://hg.mozilla.org/comm-central/rev/cfb9aed1790d
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 24.0
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: