Closed
Bug 919853
Opened 11 years ago
Closed 11 years ago
Unable to get corresponding extension from nsIMIMEService::GetPrimaryExtension
Categories
(Firefox OS Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: echou, Assigned: echou)
References
Details
Attachments
(1 file)
2.35 KB,
patch
|
bzbarsky
:
review+
arcturus
:
review+
|
Details | Diff | Splinter Review |
In order to be capable of sharing contacts via Bluetooth while no SD card installed, Gecko Bluetooth has to deal with a 'blob' but not a 'file'. The main difference is: blob doesn't have 'name' property. However, most mobile devices would turn down the file sharing request once the file name is empty or the extension is missing.
Currently Gecko Bluetooth uses function nsIMIMEService::GetPrimaryExtension(), trying to get the primary extension from mime type. Take sharing contacts as an example, the mime type "text/vcard" is sent to function GetPrimaryExtension() as the first argument, but the out parameter won't get any value.
I have traced related parts of code, found that there is a table in nsExternalHelperAppService.cpp for mapping extension and mimetype. We should add text/vcard and .vcf mapping record in that table.
Assignee | ||
Comment 1•11 years ago
|
||
This patch does:
1. Add an record of vCard mapping in table extraMimeEntries
2. Replace deprecated mime type definition "text/x-vcard" with "text/vcard"
So that we can get corresponding extension (.vcf) from vCard blobs which have mime type "text/vcard".
Hi bz,
I saw you leaving comments in bug 891334 about the extraMimeEntries change. My patch also changes that table. Could you assist with reviewing my patch?
Hi francisco,
According to RFC 6350, "text/x-vcard" should have been deprecated in favor of "text/vcard". That's why I modified the definition of TEXT_VCARD in nsMimeTypes.h. Please assist with reviewing my patch.
Assignee: nobody → echou
Attachment #808978 -
Flags: review?(francisco.jordano)
Attachment #808978 -
Flags: review?(bzbarsky)
![]() |
||
Comment 2•11 years ago
|
||
Comment on attachment 808978 [details] [diff] [review]
patch 1: v1: Add mimetype and extension mapping of vCard
r=me
Attachment #808978 -
Flags: review?(bzbarsky) → review+
Comment 3•11 years ago
|
||
Comment on attachment 808978 [details] [diff] [review]
patch 1: v1: Add mimetype and extension mapping of vCard
Looking good to me, we will change the references in the frontend to use the correct mimetype.
Thanks!
Attachment #808978 -
Flags: review?(francisco.jordano) → review+
Assignee | ||
Comment 4•11 years ago
|
||
Thank you both :)
https://hg.mozilla.org/integration/b2g-inbound/rev/b16fd01c41f6
Comment 5•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•