vCards from webpages and the desktop cannot be opened / imported to Thunderbird.

RESOLVED FIXED in Thunderbird 9.0

Status

Thunderbird
Address Book
RESOLVED FIXED
7 years ago
6 years ago

People

(Reporter: Josh Shipp, Assigned: protz)

Tracking

Thunderbird 9.0
x86
Windows 7

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

7 years ago
User-Agent:       Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0) Gecko/20100101 Firefox/4.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9

Often I find vCards on a webpages that I would like to be imported into my address book. Clicking the link, wants to bring up outlook, and even if thunderbird is selected as the correct application to open the file, Thunderbird does not appear recognize that any action has transpired. This is the same even if I save the vCard to my desktop.

Reproducible: Always

Steps to Reproduce:
1. Just as a random example there is a vCard on the page here: http://www.grubb-ellis.com/Company/OurOffices/OfficeDescription.aspx?id=1858
2. Click it and select thunderbird to open the file.
3. Sadness ensues as thunderbird does not respond to your request.
Actual Results:  
Thunderbird does not seem to recognize that a request has transpired. 

Expected Results:  
Thunderbird would open your address book, and show you where it has inserted your entry. Or in the case of multiple address books, you are prompted for the correct book to insert the new record into.
(Reporter)

Updated

7 years ago
Version: unspecified → 3.1
(Reporter)

Comment 1

7 years ago
I should have elaborated on the "saving to my desktop" sentence. If I save the vcard to my desktop and ensure the thunderbird is the associated application to open .vcf files, it still does not respond. It does not make a difference if thunderbird is open or not when this is attempted. I know TB is capable of reading vCard files, so I assume this is a limitation of TB's command-line usage.

Comment 2

7 years ago
Thunderbird 3.1.9 indeed seems to ignore VCF files completely on Windows.
I don't have Outlook installed, but after associating VCF with Thunderbird, nothing happens when double-clicking a file. Even a direct drag-and-drop
into the 3-pane or address-book window doesn't show any effect.
Component: General → Address Book
QA Contact: general → address-book
(Assignee)

Comment 3

7 years ago
If anyone can give me a kick start, like where to look for, I'd gladly try to fix this bug.
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Comment 4

7 years ago
Created attachment 557372 [details] [diff] [review]
HACK HACK HACK

This patch works, although for the reasons described in the comment, it's a hack. I haven't found a better way to achieve this, though. David, if you have any suggestions on how to do this in a less hackish way, I'd love to hear about them :-).

Here's the code that does all the work in the end: http://mxr.mozilla.org/comm-central/source/mailnews/addrbook/src/nsAbContentHandler.cpp#165 ; and VCard service is not exactly script-friendly http://mxr.mozilla.org/comm-central/source/mailnews/addrbook/public/nsIMsgVCardService.idl#49 ...

My solution results in a window flashing for a brief period of time before the "Add Contact" dialog pops up.

Don't forget to purge caches when trying this patch :).
Assignee: nobody → jonathan.protzenko
Status: NEW → ASSIGNED
Attachment #557372 - Flags: review?(squibblyflabbetydoo)
Attachment #557372 - Flags: feedback?(dbienvenu)
Comment on attachment 557372 [details] [diff] [review]
HACK HACK HACK

I'd rather think about making some of these scriptable (or adding interfaces that are scriptable) than flashing up a useless window.
Attachment #557372 - Flags: feedback-
(Assignee)

Comment 6

7 years ago
The problem is that nothing is scriptable in that area, so that sounds like a massive undertaking is required. Do you think it's actually feasible to convert http://mxr.mozilla.org/comm-central/source/mailnews/addrbook/public/nsIMsgVCardService.idl#49 to something that could be used from the command-line handler?

- I could basically write http://mxr.mozilla.org/comm-central/source/mailnews/addrbook/src/nsAbContentHandler.cpp#165 as a separate function, but that would be very ad-hoc and not very useful except for that specific case.
- I could make the vCardService scriptable, and that would somehow be useful, but given the current state of it, I think it's hard.

Thoughts?

Comment 7

7 years ago
I agree that making nsIMsgVCardService scriptable is not particularly feasible. Could you add a method to nsIMsgVCardService that can import a vcard given a file name? Or a stream?

You could open the window offscreen so that it doesn't flash, or open it hidden. Still hacky, but the user wouldn't know.
(Assignee)

Comment 8

7 years ago
Created attachment 557601 [details] [diff] [review]
No hack

Here's a less hackish version. There's no prior validation of the contents to ensure this is a valid vcard, which will result in an "add contact" dialog with nothing pre-filled if the vcard is invalid.

I don't know the vcard parser, but does the vCardService->Parse_MIME function do anything else besides checking that it's valid? The escapedVCardToAbCard seems to imply that the string has to be "escaped" beforehand, but I'm not sure what that means...

Anyway, it works for me \o/ :)
Attachment #557372 - Attachment is obsolete: true
Attachment #557372 - Flags: review?(squibblyflabbetydoo)
Attachment #557372 - Flags: feedback?(dbienvenu)
Attachment #557601 - Flags: review?(mbanner)
Comment on attachment 557601 [details] [diff] [review]
No hack

This looks reasonable, but I can't actually test it at the moment, so passing review to squib.

I'm a little concerned about the modal window without a parent though.

Also I think you could catch the fact that card is null and not display a dialog. Dunno if we'd want to also display a prompt or just log something to the error console (or do nothing). bwinton may have some ideas there.
Attachment #557601 - Flags: review?(squibblyflabbetydoo)
Attachment #557601 - Flags: review?(mbanner)
Attachment #557601 - Flags: feedback+

Comment 10

6 years ago
Comment on attachment 557601 [details] [diff] [review]
No hack

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

This seems to work. I'm pretty unfamiliar with vCards, so I'm not 100% sure how we want this to behave. For instance, if Thunderbird isn't open, should we really add the card and close immediately? In any case, this is a pretty big improvement over how things work now, so r+.
Attachment #557601 - Flags: review?(squibblyflabbetydoo) → review+
(Assignee)

Comment 11

6 years ago
http://hg.mozilla.org/comm-central/rev/adb328ea98c9
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 9.0
You need to log in before you can comment on or make changes to this bug.