Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix for attachment content type handling on iOS.

  • Loading branch information...
commit e44d7169a6e8b35e34fb87262dda1257f2504b69 1 parent 053ab83
Kris Wong authored
View
4 MailCore.xcodeproj/project.pbxproj
@@ -7,6 +7,7 @@
objects = {
/* Begin PBXBuildFile section */
+ 0F134A871656D718000D1E83 /* types.plist in Resources */ = {isa = PBXBuildFile; fileRef = 0F134A861656D718000D1E83 /* types.plist */; };
0F369D03162DF5030043A3ED /* CTXlistResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F369D01162DF5030043A3ED /* CTXlistResult.h */; settings = {ATTRIBUTES = (Public, ); }; };
0F369D04162DF5030043A3ED /* CTXlistResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 0F369D02162DF5030043A3ED /* CTXlistResult.m */; };
0FFA954C16559D4F00A89EA0 /* CTXlistResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 0F369D02162DF5030043A3ED /* CTXlistResult.m */; };
@@ -215,6 +216,7 @@
/* Begin PBXFileReference section */
0867D69BFE84028FC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
0867D6A5FE840307C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
+ 0F134A861656D718000D1E83 /* types.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = types.plist; path = Resources/types.plist; sourceTree = "<group>"; };
0F369D01162DF5030043A3ED /* CTXlistResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CTXlistResult.h; path = Source/CTXlistResult.h; sourceTree = "<group>"; };
0F369D02162DF5030043A3ED /* CTXlistResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CTXlistResult.m; path = Source/CTXlistResult.m; sourceTree = "<group>"; };
1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
@@ -381,6 +383,7 @@
089C1665FE841158C02AAC07 /* Resources */ = {
isa = PBXGroup;
children = (
+ 0F134A861656D718000D1E83 /* types.plist */,
F81B88700A74AAD800143DF6 /* Info.plist */,
);
name = Resources;
@@ -772,6 +775,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ 0F134A871656D718000D1E83 /* types.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
568 Resources/types.plist
@@ -0,0 +1,568 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>application/andrew-inset</key>
+ <array>
+ <string>ez</string>
+ </array>
+ <key>application/java-archive</key>
+ <array>
+ <string>jar</string>
+ </array>
+ <key>application/mac-binhex40</key>
+ <array>
+ <string>hqx</string>
+ </array>
+ <key>application/mac-compactpro</key>
+ <array>
+ <string>cpt</string>
+ </array>
+ <key>application/msword</key>
+ <array>
+ <string>doc</string>
+ </array>
+ <key>application/octet-stream</key>
+ <array>
+ <string>dms</string>
+ <string>lha</string>
+ <string>lzh</string>
+ <string>exe</string>
+ <string>class</string>
+ <string>so</string>
+ <string>dll</string>
+ <string>iso</string>
+ <string>fla</string>
+ </array>
+ <key>application/oda</key>
+ <array>
+ <string>oda</string>
+ </array>
+ <key>application/pdf</key>
+ <array>
+ <string>pdf</string>
+ </array>
+ <key>application/postscript</key>
+ <array>
+ <string>eps</string>
+ <string>ai</string>
+ <string>ps</string>
+ </array>
+ <key>application/smil</key>
+ <array>
+ <string>smil</string>
+ </array>
+ <key>application/vnd.adobe.xdp+xml</key>
+ <array>
+ <string>xdp</string>
+ </array>
+ <key>application/vnd.adobe.xfd+xml</key>
+ <array>
+ <string>xfd</string>
+ </array>
+ <key>application/vnd.adobe.xfdf</key>
+ <array>
+ <string>xfdf</string>
+ </array>
+ <key>application/vnd.fdf</key>
+ <array>
+ <string>fdf</string>
+ </array>
+ <key>application/vnd.mif</key>
+ <array>
+ <string>mif</string>
+ </array>
+ <key>application/vnd.ms-excel</key>
+ <array>
+ <string>xls</string>
+ </array>
+ <key>application/vnd.ms-powerpoint</key>
+ <array>
+ <string>ppt</string>
+ </array>
+ <key>application/vnd.wap.wbxml</key>
+ <array>
+ <string>wbxml</string>
+ </array>
+ <key>application/vnd.wap.wmlc</key>
+ <array>
+ <string>wmlc</string>
+ </array>
+ <key>application/vnd.wap.wmlscriptc</key>
+ <array>
+ <string>wmlsc</string>
+ </array>
+ <key>application/x-bcpio</key>
+ <array>
+ <string>bcpio</string>
+ </array>
+ <key>application/x-cdlink</key>
+ <array>
+ <string>vcd</string>
+ </array>
+ <key>application/x-chess-pgn</key>
+ <array>
+ <string>pgn</string>
+ </array>
+ <key>application/x-compress</key>
+ <array>
+ <string>Z</string>
+ </array>
+ <key>application/x-cpio</key>
+ <array>
+ <string>cpio</string>
+ </array>
+ <key>application/x-csh</key>
+ <array>
+ <string>csh</string>
+ </array>
+ <key>application/x-director</key>
+ <array>
+ <string>dcr</string>
+ <string>dir</string>
+ <string>dxr</string>
+ </array>
+ <key>application/x-diskcopy</key>
+ <array>
+ <string>smi</string>
+ <string>dmg</string>
+ </array>
+ <key>application/x-dvi</key>
+ <array>
+ <string>dvi</string>
+ </array>
+ <key>application/x-filemaker</key>
+ <array>
+ <string>fp6</string>
+ <string>fp5</string>
+ <string>fp4</string>
+ <string>fp3</string>
+ <string>fp2</string>
+ <string>fp</string>
+ </array>
+ <key>application/x-futuresplash</key>
+ <array>
+ <string>spl</string>
+ </array>
+ <key>application/x-gtar</key>
+ <array>
+ <string>gtar</string>
+ </array>
+ <key>application/x-gzip</key>
+ <array>
+ <string>gz</string>
+ <string>tgz</string>
+ <string>cpgz</string>
+ </array>
+ <key>application/x-hdf</key>
+ <array>
+ <string>hdf</string>
+ </array>
+ <key>application/x-java-jnlp-file</key>
+ <array>
+ <string>jnlp</string>
+ </array>
+ <key>application/x-javascript</key>
+ <array>
+ <string>js</string>
+ </array>
+ <key>application/x-koan</key>
+ <array>
+ <string>skp</string>
+ <string>skd</string>
+ <string>skt</string>
+ <string>skm</string>
+ </array>
+ <key>application/x-latex</key>
+ <array>
+ <string>latex</string>
+ </array>
+ <key>application/x-ms-wmd</key>
+ <array>
+ <string>wmd</string>
+ </array>
+ <key>application/x-netcdf</key>
+ <array>
+ <string>nc</string>
+ <string>cdf</string>
+ </array>
+ <key>application/x-photoshop</key>
+ <array>
+ <string>psd</string>
+ </array>
+ <key>application/x-sh</key>
+ <array>
+ <string>sh</string>
+ </array>
+ <key>application/x-shar</key>
+ <array>
+ <string>shar</string>
+ </array>
+ <key>application/x-shockwave-flash</key>
+ <array>
+ <string>swf</string>
+ </array>
+ <key>application/x-stuffit</key>
+ <array>
+ <string>sit</string>
+ </array>
+ <key>application/x-sv4cpio</key>
+ <array>
+ <string>sv4cpio</string>
+ </array>
+ <key>application/x-sv4crc</key>
+ <array>
+ <string>sv4crc</string>
+ </array>
+ <key>application/x-tar</key>
+ <array>
+ <string>tar</string>
+ </array>
+ <key>application/x-tcl</key>
+ <array>
+ <string>tcl</string>
+ </array>
+ <key>application/x-tex</key>
+ <array>
+ <string>tex</string>
+ </array>
+ <key>application/x-texinfo</key>
+ <array>
+ <string>texinfo</string>
+ <string>texi</string>
+ </array>
+ <key>application/x-troff</key>
+ <array>
+ <string>t</string>
+ <string>tr</string>
+ <string>roff</string>
+ </array>
+ <key>application/x-troff-man</key>
+ <array>
+ <string>man</string>
+ </array>
+ <key>application/x-troff-me</key>
+ <array>
+ <string>me</string>
+ </array>
+ <key>application/x-troff-ms</key>
+ <array>
+ <string>ms</string>
+ </array>
+ <key>application/x-ustar</key>
+ <array>
+ <string>ustar</string>
+ </array>
+ <key>application/x-wais-source</key>
+ <array>
+ <string>src</string>
+ </array>
+ <key>application/x-webarchive</key>
+ <array>
+ <string>webarchive</string>
+ </array>
+ <key>application/xhtml+xml</key>
+ <array>
+ <string>xhtml</string>
+ <string>xhtm</string>
+ </array>
+ <key>application/xml</key>
+ <array>
+ <string>xml</string>
+ </array>
+ <key>application/zip</key>
+ <array>
+ <string>zip</string>
+ </array>
+ <key>audio/basic</key>
+ <array>
+ <string>au</string>
+ <string>snd</string>
+ </array>
+ <key>audio/midi</key>
+ <array>
+ <string>mid</string>
+ <string>midi</string>
+ <string>kar</string>
+ </array>
+ <key>audio/mpeg</key>
+ <array>
+ <string>mp3</string>
+ <string>mpga</string>
+ <string>mp2</string>
+ </array>
+ <key>audio/scpls</key>
+ <array>
+ <string>pls</string>
+ </array>
+ <key>audio/x-aiff</key>
+ <array>
+ <string>aif</string>
+ <string>aiff</string>
+ <string>aifc</string>
+ </array>
+ <key>audio/x-m4p</key>
+ <array>
+ <string>m4p</string>
+ </array>
+ <key>audio/x-mpegurl</key>
+ <array>
+ <string>m3u</string>
+ </array>
+ <key>audio/x-ms-wma</key>
+ <array>
+ <string>wma</string>
+ </array>
+ <key>audio/x-pn-realaudio</key>
+ <array>
+ <string>ram</string>
+ <string>rm</string>
+ </array>
+ <key>audio/x-pn-realaudio-plugin</key>
+ <array>
+ <string>rpm</string>
+ </array>
+ <key>audio/x-realaudio</key>
+ <array>
+ <string>ra</string>
+ </array>
+ <key>audio/x-wav</key>
+ <array>
+ <string>wav</string>
+ </array>
+ <key>chemical/x-pdb</key>
+ <array>
+ <string>pdb</string>
+ </array>
+ <key>chemical/x-xyz</key>
+ <array>
+ <string>xyz</string>
+ </array>
+ <key>image/bmp</key>
+ <array>
+ <string>bmp</string>
+ </array>
+ <key>image/gif</key>
+ <array>
+ <string>gif</string>
+ </array>
+ <key>image/ief</key>
+ <array>
+ <string>ief</string>
+ </array>
+ <key>image/jp2</key>
+ <array>
+ <string>jp2</string>
+ </array>
+ <key>image/jpeg</key>
+ <array>
+ <string>jpg</string>
+ <string>jpeg</string>
+ <string>jpe</string>
+ </array>
+ <key>image/pict</key>
+ <array>
+ <string>pict</string>
+ <string>pic</string>
+ </array>
+ <key>image/png</key>
+ <array>
+ <string>png</string>
+ </array>
+ <key>image/quicktime</key>
+ <array>
+ <string>qti</string>
+ <string>qtif</string>
+ </array>
+ <key>image/svg+xml</key>
+ <array>
+ <string>svg</string>
+ <string>svgz</string>
+ </array>
+ <key>image/tiff</key>
+ <array>
+ <string>tiff</string>
+ <string>tif</string>
+ </array>
+ <key>image/vnd.wap.wbmp</key>
+ <array>
+ <string>wbmp</string>
+ </array>
+ <key>image/x-cmu-raster</key>
+ <array>
+ <string>ras</string>
+ </array>
+ <key>image/x-icon</key>
+ <array>
+ <string>ico</string>
+ </array>
+ <key>image/x-macpaint</key>
+ <array>
+ <string>pnt</string>
+ <string>pntg</string>
+ <string>mac</string>
+ </array>
+ <key>image/x-pcx</key>
+ <array>
+ <string>pcx</string>
+ </array>
+ <key>image/x-portable-anymap</key>
+ <array>
+ <string>pnm</string>
+ </array>
+ <key>image/x-portable-bitmap</key>
+ <array>
+ <string>pbm</string>
+ </array>
+ <key>image/x-portable-graymap</key>
+ <array>
+ <string>pgm</string>
+ </array>
+ <key>image/x-portable-pixmap</key>
+ <array>
+ <string>ppm</string>
+ </array>
+ <key>image/x-rgb</key>
+ <array>
+ <string>rgb</string>
+ </array>
+ <key>image/x-targa</key>
+ <array>
+ <string>targa</string>
+ </array>
+ <key>image/x-xbitmap</key>
+ <array>
+ <string>xbm</string>
+ </array>
+ <key>image/x-xpixmap</key>
+ <array>
+ <string>xpm</string>
+ </array>
+ <key>image/x-xwindowdump</key>
+ <array>
+ <string>xwd</string>
+ </array>
+ <key>model/iges</key>
+ <array>
+ <string>igs</string>
+ <string>iges</string>
+ </array>
+ <key>model/mesh</key>
+ <array>
+ <string>msh</string>
+ <string>mesh</string>
+ <string>silo</string>
+ </array>
+ <key>model/vrml</key>
+ <array>
+ <string>wrl</string>
+ <string>vrml</string>
+ </array>
+ <key>text/calendar</key>
+ <array>
+ <string>ics</string>
+ </array>
+ <key>text/css</key>
+ <array>
+ <string>css</string>
+ </array>
+ <key>text/html</key>
+ <array>
+ <string>html</string>
+ <string>htm</string>
+ <string>shtml</string>
+ <string>jhtml</string>
+ </array>
+ <key>text/plain</key>
+ <array>
+ <string>txt</string>
+ <string>asc</string>
+ <string>text</string>
+ </array>
+ <key>text/qif</key>
+ <array>
+ <string>qif</string>
+ </array>
+ <key>text/richtext</key>
+ <array>
+ <string>rtx</string>
+ </array>
+ <key>text/rtf</key>
+ <array>
+ <string>rtf</string>
+ </array>
+ <key>text/sgml</key>
+ <array>
+ <string>sgml</string>
+ <string>sgm</string>
+ </array>
+ <key>text/tab-separated-values</key>
+ <array>
+ <string>tsv</string>
+ </array>
+ <key>text/vcard</key>
+ <array>
+ <string>vcf</string>
+ </array>
+ <key>text/vnd.wap.wml</key>
+ <array>
+ <string>wml</string>
+ </array>
+ <key>text/vnd.wap.wmlscript</key>
+ <array>
+ <string>wmls</string>
+ </array>
+ <key>text/x-setext</key>
+ <array>
+ <string>etx</string>
+ </array>
+ <key>text/xml</key>
+ <array>
+ <string>xml</string>
+ <string>xsl</string>
+ </array>
+ <key>video/mpeg</key>
+ <array>
+ <string>mpeg</string>
+ <string>mpg</string>
+ <string>mpe</string>
+ </array>
+ <key>video/quicktime</key>
+ <array>
+ <string>qt</string>
+ <string>mov</string>
+ </array>
+ <key>video/vnd.mpegurl</key>
+ <array>
+ <string>mxu</string>
+ </array>
+ <key>video/x-ms-asf</key>
+ <array>
+ <string>asf</string>
+ </array>
+ <key>video/x-ms-wmv</key>
+ <array>
+ <string>wmv</string>
+ </array>
+ <key>video/x-ms-wmx</key>
+ <array>
+ <string>wmx</string>
+ </array>
+ <key>video/x-ms.wmp</key>
+ <array>
+ <string>wmp</string>
+ </array>
+ <key>video/x-msvideo</key>
+ <array>
+ <string>avi</string>
+ </array>
+ <key>video/x-sgi-movie</key>
+ <array>
+ <string>movie</string>
+ </array>
+ <key>x-conference/x-cooltalk</key>
+ <array>
+ <string>ice</string>
+ </array>
+</dict>
+</plist>
View
4 Source/CTCoreAttachment.m
@@ -41,8 +41,8 @@ - (id)initWithContentsOfFile:(NSString *)path {
NSString *filePathExt = [path pathExtension];
NSString *contentType = nil;
- //TODO: This won't work on iOS
- NSDictionary *contentTypes = [NSDictionary dictionaryWithContentsOfFile:CTContentTypesPath];
+ NSString *typesPath = [[NSBundle mainBundle] pathForResource:@"types" ofType:@"plist"];
+ NSDictionary *contentTypes = [NSDictionary dictionaryWithContentsOfFile:typesPath];
for (NSString *key in [contentTypes allKeys]) {
NSArray *fileExtensions = [contentTypes objectForKey:key];
for (NSString *ext in fileExtensions) {

0 comments on commit e44d716

Please sign in to comment.
Something went wrong with that request. Please try again.