Skip to content
This repository
Browse code

Fix for attachment content type handling on iOS.

  • Loading branch information...
commit e44d7169a6e8b35e34fb87262dda1257f2504b69 1 parent 053ab83
authored November 16, 2012
4  MailCore.xcodeproj/project.pbxproj
@@ -7,6 +7,7 @@
7 7
 	objects = {
8 8
 
9 9
 /* Begin PBXBuildFile section */
  10
+		0F134A871656D718000D1E83 /* types.plist in Resources */ = {isa = PBXBuildFile; fileRef = 0F134A861656D718000D1E83 /* types.plist */; };
10 11
 		0F369D03162DF5030043A3ED /* CTXlistResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F369D01162DF5030043A3ED /* CTXlistResult.h */; settings = {ATTRIBUTES = (Public, ); }; };
11 12
 		0F369D04162DF5030043A3ED /* CTXlistResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 0F369D02162DF5030043A3ED /* CTXlistResult.m */; };
12 13
 		0FFA954C16559D4F00A89EA0 /* CTXlistResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 0F369D02162DF5030043A3ED /* CTXlistResult.m */; };
@@ -215,6 +216,7 @@
215 216
 /* Begin PBXFileReference section */
216 217
 		0867D69BFE84028FC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
217 218
 		0867D6A5FE840307C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
  219
+		0F134A861656D718000D1E83 /* types.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = types.plist; path = Resources/types.plist; sourceTree = "<group>"; };
218 220
 		0F369D01162DF5030043A3ED /* CTXlistResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CTXlistResult.h; path = Source/CTXlistResult.h; sourceTree = "<group>"; };
219 221
 		0F369D02162DF5030043A3ED /* CTXlistResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CTXlistResult.m; path = Source/CTXlistResult.m; sourceTree = "<group>"; };
220 222
 		1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
@@ -381,6 +383,7 @@
381 383
 		089C1665FE841158C02AAC07 /* Resources */ = {
382 384
 			isa = PBXGroup;
383 385
 			children = (
  386
+				0F134A861656D718000D1E83 /* types.plist */,
384 387
 				F81B88700A74AAD800143DF6 /* Info.plist */,
385 388
 			);
386 389
 			name = Resources;
@@ -772,6 +775,7 @@
772 775
 			isa = PBXResourcesBuildPhase;
773 776
 			buildActionMask = 2147483647;
774 777
 			files = (
  778
+				0F134A871656D718000D1E83 /* types.plist in Resources */,
775 779
 			);
776 780
 			runOnlyForDeploymentPostprocessing = 0;
777 781
 		};
568  Resources/types.plist
... ...
@@ -0,0 +1,568 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  3
+<plist version="1.0">
  4
+<dict>
  5
+	<key>application/andrew-inset</key>
  6
+	<array>
  7
+		<string>ez</string>
  8
+	</array>
  9
+	<key>application/java-archive</key>
  10
+	<array>
  11
+		<string>jar</string>
  12
+	</array>
  13
+	<key>application/mac-binhex40</key>
  14
+	<array>
  15
+		<string>hqx</string>
  16
+	</array>
  17
+	<key>application/mac-compactpro</key>
  18
+	<array>
  19
+		<string>cpt</string>
  20
+	</array>
  21
+	<key>application/msword</key>
  22
+	<array>
  23
+		<string>doc</string>
  24
+	</array>
  25
+	<key>application/octet-stream</key>
  26
+	<array>
  27
+		<string>dms</string>
  28
+		<string>lha</string>
  29
+		<string>lzh</string>
  30
+		<string>exe</string>
  31
+		<string>class</string>
  32
+		<string>so</string>
  33
+		<string>dll</string>
  34
+		<string>iso</string>
  35
+		<string>fla</string>
  36
+	</array>
  37
+	<key>application/oda</key>
  38
+	<array>
  39
+		<string>oda</string>
  40
+	</array>
  41
+	<key>application/pdf</key>
  42
+	<array>
  43
+		<string>pdf</string>
  44
+	</array>
  45
+	<key>application/postscript</key>
  46
+	<array>
  47
+		<string>eps</string>
  48
+		<string>ai</string>
  49
+		<string>ps</string>
  50
+	</array>
  51
+	<key>application/smil</key>
  52
+	<array>
  53
+		<string>smil</string>
  54
+	</array>
  55
+	<key>application/vnd.adobe.xdp+xml</key>
  56
+	<array>
  57
+		<string>xdp</string>
  58
+	</array>
  59
+	<key>application/vnd.adobe.xfd+xml</key>
  60
+	<array>
  61
+		<string>xfd</string>
  62
+	</array>
  63
+	<key>application/vnd.adobe.xfdf</key>
  64
+	<array>
  65
+		<string>xfdf</string>
  66
+	</array>
  67
+	<key>application/vnd.fdf</key>
  68
+	<array>
  69
+		<string>fdf</string>
  70
+	</array>
  71
+	<key>application/vnd.mif</key>
  72
+	<array>
  73
+		<string>mif</string>
  74
+	</array>
  75
+	<key>application/vnd.ms-excel</key>
  76
+	<array>
  77
+		<string>xls</string>
  78
+	</array>
  79
+	<key>application/vnd.ms-powerpoint</key>
  80
+	<array>
  81
+		<string>ppt</string>
  82
+	</array>
  83
+	<key>application/vnd.wap.wbxml</key>
  84
+	<array>
  85
+		<string>wbxml</string>
  86
+	</array>
  87
+	<key>application/vnd.wap.wmlc</key>
  88
+	<array>
  89
+		<string>wmlc</string>
  90
+	</array>
  91
+	<key>application/vnd.wap.wmlscriptc</key>
  92
+	<array>
  93
+		<string>wmlsc</string>
  94
+	</array>
  95
+	<key>application/x-bcpio</key>
  96
+	<array>
  97
+		<string>bcpio</string>
  98
+	</array>
  99
+	<key>application/x-cdlink</key>
  100
+	<array>
  101
+		<string>vcd</string>
  102
+	</array>
  103
+	<key>application/x-chess-pgn</key>
  104
+	<array>
  105
+		<string>pgn</string>
  106
+	</array>
  107
+	<key>application/x-compress</key>
  108
+	<array>
  109
+		<string>Z</string>
  110
+	</array>
  111
+	<key>application/x-cpio</key>
  112
+	<array>
  113
+		<string>cpio</string>
  114
+	</array>
  115
+	<key>application/x-csh</key>
  116
+	<array>
  117
+		<string>csh</string>
  118
+	</array>
  119
+	<key>application/x-director</key>
  120
+	<array>
  121
+		<string>dcr</string>
  122
+		<string>dir</string>
  123
+		<string>dxr</string>
  124
+	</array>
  125
+	<key>application/x-diskcopy</key>
  126
+	<array>
  127
+		<string>smi</string>
  128
+		<string>dmg</string>
  129
+	</array>
  130
+	<key>application/x-dvi</key>
  131
+	<array>
  132
+		<string>dvi</string>
  133
+	</array>
  134
+	<key>application/x-filemaker</key>
  135
+	<array>
  136
+		<string>fp6</string>
  137
+		<string>fp5</string>
  138
+		<string>fp4</string>
  139
+		<string>fp3</string>
  140
+		<string>fp2</string>
  141
+		<string>fp</string>
  142
+	</array>
  143
+	<key>application/x-futuresplash</key>
  144
+	<array>
  145
+		<string>spl</string>
  146
+	</array>
  147
+	<key>application/x-gtar</key>
  148
+	<array>
  149
+		<string>gtar</string>
  150
+	</array>
  151
+	<key>application/x-gzip</key>
  152
+	<array>
  153
+		<string>gz</string>
  154
+		<string>tgz</string>
  155
+		<string>cpgz</string>
  156
+	</array>
  157
+	<key>application/x-hdf</key>
  158
+	<array>
  159
+		<string>hdf</string>
  160
+	</array>
  161
+	<key>application/x-java-jnlp-file</key>
  162
+	<array>
  163
+		<string>jnlp</string>
  164
+	</array>
  165
+	<key>application/x-javascript</key>
  166
+	<array>
  167
+		<string>js</string>
  168
+	</array>
  169
+	<key>application/x-koan</key>
  170
+	<array>
  171
+		<string>skp</string>
  172
+		<string>skd</string>
  173
+		<string>skt</string>
  174
+		<string>skm</string>
  175
+	</array>
  176
+	<key>application/x-latex</key>
  177
+	<array>
  178
+		<string>latex</string>
  179
+	</array>
  180
+	<key>application/x-ms-wmd</key>
  181
+	<array>
  182
+		<string>wmd</string>
  183
+	</array>
  184
+	<key>application/x-netcdf</key>
  185
+	<array>
  186
+		<string>nc</string>
  187
+		<string>cdf</string>
  188
+	</array>
  189
+	<key>application/x-photoshop</key>
  190
+	<array>
  191
+		<string>psd</string>
  192
+	</array>
  193
+	<key>application/x-sh</key>
  194
+	<array>
  195
+		<string>sh</string>
  196
+	</array>
  197
+	<key>application/x-shar</key>
  198
+	<array>
  199
+		<string>shar</string>
  200
+	</array>
  201
+	<key>application/x-shockwave-flash</key>
  202
+	<array>
  203
+		<string>swf</string>
  204
+	</array>
  205
+	<key>application/x-stuffit</key>
  206
+	<array>
  207
+		<string>sit</string>
  208
+	</array>
  209
+	<key>application/x-sv4cpio</key>
  210
+	<array>
  211
+		<string>sv4cpio</string>
  212
+	</array>
  213
+	<key>application/x-sv4crc</key>
  214
+	<array>
  215
+		<string>sv4crc</string>
  216
+	</array>
  217
+	<key>application/x-tar</key>
  218
+	<array>
  219
+		<string>tar</string>
  220
+	</array>
  221
+	<key>application/x-tcl</key>
  222
+	<array>
  223
+		<string>tcl</string>
  224
+	</array>
  225
+	<key>application/x-tex</key>
  226
+	<array>
  227
+		<string>tex</string>
  228
+	</array>
  229
+	<key>application/x-texinfo</key>
  230
+	<array>
  231
+		<string>texinfo</string>
  232
+		<string>texi</string>
  233
+	</array>
  234
+	<key>application/x-troff</key>
  235
+	<array>
  236
+		<string>t</string>
  237
+		<string>tr</string>
  238
+		<string>roff</string>
  239
+	</array>
  240
+	<key>application/x-troff-man</key>
  241
+	<array>
  242
+		<string>man</string>
  243
+	</array>
  244
+	<key>application/x-troff-me</key>
  245
+	<array>
  246
+		<string>me</string>
  247
+	</array>
  248
+	<key>application/x-troff-ms</key>
  249
+	<array>
  250
+		<string>ms</string>
  251
+	</array>
  252
+	<key>application/x-ustar</key>
  253
+	<array>
  254
+		<string>ustar</string>
  255
+	</array>
  256
+	<key>application/x-wais-source</key>
  257
+	<array>
  258
+		<string>src</string>
  259
+	</array>
  260
+	<key>application/x-webarchive</key>
  261
+	<array>
  262
+		<string>webarchive</string>
  263
+	</array>
  264
+	<key>application/xhtml+xml</key>
  265
+	<array>
  266
+		<string>xhtml</string>
  267
+		<string>xhtm</string>
  268
+	</array>
  269
+	<key>application/xml</key>
  270
+	<array>
  271
+		<string>xml</string>
  272
+	</array>
  273
+	<key>application/zip</key>
  274
+	<array>
  275
+		<string>zip</string>
  276
+	</array>
  277
+	<key>audio/basic</key>
  278
+	<array>
  279
+		<string>au</string>
  280
+		<string>snd</string>
  281
+	</array>
  282
+	<key>audio/midi</key>
  283
+	<array>
  284
+		<string>mid</string>
  285
+		<string>midi</string>
  286
+		<string>kar</string>
  287
+	</array>
  288
+	<key>audio/mpeg</key>
  289
+	<array>
  290
+		<string>mp3</string>
  291
+		<string>mpga</string>
  292
+		<string>mp2</string>
  293
+	</array>
  294
+	<key>audio/scpls</key>
  295
+	<array>
  296
+		<string>pls</string>
  297
+	</array>
  298
+	<key>audio/x-aiff</key>
  299
+	<array>
  300
+		<string>aif</string>
  301
+		<string>aiff</string>
  302
+		<string>aifc</string>
  303
+	</array>
  304
+	<key>audio/x-m4p</key>
  305
+	<array>
  306
+		<string>m4p</string>
  307
+	</array>
  308
+	<key>audio/x-mpegurl</key>
  309
+	<array>
  310
+		<string>m3u</string>
  311
+	</array>
  312
+	<key>audio/x-ms-wma</key>
  313
+	<array>
  314
+		<string>wma</string>
  315
+	</array>
  316
+	<key>audio/x-pn-realaudio</key>
  317
+	<array>
  318
+		<string>ram</string>
  319
+		<string>rm</string>
  320
+	</array>
  321
+	<key>audio/x-pn-realaudio-plugin</key>
  322
+	<array>
  323
+		<string>rpm</string>
  324
+	</array>
  325
+	<key>audio/x-realaudio</key>
  326
+	<array>
  327
+		<string>ra</string>
  328
+	</array>
  329
+	<key>audio/x-wav</key>
  330
+	<array>
  331
+		<string>wav</string>
  332
+	</array>
  333
+	<key>chemical/x-pdb</key>
  334
+	<array>
  335
+		<string>pdb</string>
  336
+	</array>
  337
+	<key>chemical/x-xyz</key>
  338
+	<array>
  339
+		<string>xyz</string>
  340
+	</array>
  341
+	<key>image/bmp</key>
  342
+	<array>
  343
+		<string>bmp</string>
  344
+	</array>
  345
+	<key>image/gif</key>
  346
+	<array>
  347
+		<string>gif</string>
  348
+	</array>
  349
+	<key>image/ief</key>
  350
+	<array>
  351
+		<string>ief</string>
  352
+	</array>
  353
+	<key>image/jp2</key>
  354
+	<array>
  355
+		<string>jp2</string>
  356
+	</array>
  357
+	<key>image/jpeg</key>
  358
+	<array>
  359
+		<string>jpg</string>
  360
+		<string>jpeg</string>
  361
+		<string>jpe</string>
  362
+	</array>
  363
+	<key>image/pict</key>
  364
+	<array>
  365
+		<string>pict</string>
  366
+		<string>pic</string>
  367
+	</array>
  368
+	<key>image/png</key>
  369
+	<array>
  370
+		<string>png</string>
  371
+	</array>
  372
+	<key>image/quicktime</key>
  373
+	<array>
  374
+		<string>qti</string>
  375
+		<string>qtif</string>
  376
+	</array>
  377
+	<key>image/svg+xml</key>
  378
+	<array>
  379
+		<string>svg</string>
  380
+		<string>svgz</string>
  381
+	</array>
  382
+	<key>image/tiff</key>
  383
+	<array>
  384
+		<string>tiff</string>
  385
+		<string>tif</string>
  386
+	</array>
  387
+	<key>image/vnd.wap.wbmp</key>
  388
+	<array>
  389
+		<string>wbmp</string>
  390
+	</array>
  391
+	<key>image/x-cmu-raster</key>
  392
+	<array>
  393
+		<string>ras</string>
  394
+	</array>
  395
+	<key>image/x-icon</key>
  396
+	<array>
  397
+		<string>ico</string>
  398
+	</array>
  399
+	<key>image/x-macpaint</key>
  400
+	<array>
  401
+		<string>pnt</string>
  402
+		<string>pntg</string>
  403
+		<string>mac</string>
  404
+	</array>
  405
+	<key>image/x-pcx</key>
  406
+	<array>
  407
+		<string>pcx</string>
  408
+	</array>
  409
+	<key>image/x-portable-anymap</key>
  410
+	<array>
  411
+		<string>pnm</string>
  412
+	</array>
  413
+	<key>image/x-portable-bitmap</key>
  414
+	<array>
  415
+		<string>pbm</string>
  416
+	</array>
  417
+	<key>image/x-portable-graymap</key>
  418
+	<array>
  419
+		<string>pgm</string>
  420
+	</array>
  421
+	<key>image/x-portable-pixmap</key>
  422
+	<array>
  423
+		<string>ppm</string>
  424
+	</array>
  425
+	<key>image/x-rgb</key>
  426
+	<array>
  427
+		<string>rgb</string>
  428
+	</array>
  429
+	<key>image/x-targa</key>
  430
+	<array>
  431
+		<string>targa</string>
  432
+	</array>
  433
+	<key>image/x-xbitmap</key>
  434
+	<array>
  435
+		<string>xbm</string>
  436
+	</array>
  437
+	<key>image/x-xpixmap</key>
  438
+	<array>
  439
+		<string>xpm</string>
  440
+	</array>
  441
+	<key>image/x-xwindowdump</key>
  442
+	<array>
  443
+		<string>xwd</string>
  444
+	</array>
  445
+	<key>model/iges</key>
  446
+	<array>
  447
+		<string>igs</string>
  448
+		<string>iges</string>
  449
+	</array>
  450
+	<key>model/mesh</key>
  451
+	<array>
  452
+		<string>msh</string>
  453
+		<string>mesh</string>
  454
+		<string>silo</string>
  455
+	</array>
  456
+	<key>model/vrml</key>
  457
+	<array>
  458
+		<string>wrl</string>
  459
+		<string>vrml</string>
  460
+	</array>
  461
+	<key>text/calendar</key>
  462
+	<array>
  463
+		<string>ics</string>
  464
+	</array>
  465
+	<key>text/css</key>
  466
+	<array>
  467
+		<string>css</string>
  468
+	</array>
  469
+	<key>text/html</key>
  470
+	<array>
  471
+		<string>html</string>
  472
+		<string>htm</string>
  473
+		<string>shtml</string>
  474
+		<string>jhtml</string>
  475
+	</array>
  476
+	<key>text/plain</key>
  477
+	<array>
  478
+		<string>txt</string>
  479
+		<string>asc</string>
  480
+		<string>text</string>
  481
+	</array>
  482
+	<key>text/qif</key>
  483
+	<array>
  484
+		<string>qif</string>
  485
+	</array>
  486
+	<key>text/richtext</key>
  487
+	<array>
  488
+		<string>rtx</string>
  489
+	</array>
  490
+	<key>text/rtf</key>
  491
+	<array>
  492
+		<string>rtf</string>
  493
+	</array>
  494
+	<key>text/sgml</key>
  495
+	<array>
  496
+		<string>sgml</string>
  497
+		<string>sgm</string>
  498
+	</array>
  499
+	<key>text/tab-separated-values</key>
  500
+	<array>
  501
+		<string>tsv</string>
  502
+	</array>
  503
+	<key>text/vcard</key>
  504
+	<array>
  505
+		<string>vcf</string>
  506
+	</array>
  507
+	<key>text/vnd.wap.wml</key>
  508
+	<array>
  509
+		<string>wml</string>
  510
+	</array>
  511
+	<key>text/vnd.wap.wmlscript</key>
  512
+	<array>
  513
+		<string>wmls</string>
  514
+	</array>
  515
+	<key>text/x-setext</key>
  516
+	<array>
  517
+		<string>etx</string>
  518
+	</array>
  519
+	<key>text/xml</key>
  520
+	<array>
  521
+		<string>xml</string>
  522
+		<string>xsl</string>
  523
+	</array>
  524
+	<key>video/mpeg</key>
  525
+	<array>
  526
+		<string>mpeg</string>
  527
+		<string>mpg</string>
  528
+		<string>mpe</string>
  529
+	</array>
  530
+	<key>video/quicktime</key>
  531
+	<array>
  532
+		<string>qt</string>
  533
+		<string>mov</string>
  534
+	</array>
  535
+	<key>video/vnd.mpegurl</key>
  536
+	<array>
  537
+		<string>mxu</string>
  538
+	</array>
  539
+	<key>video/x-ms-asf</key>
  540
+	<array>
  541
+		<string>asf</string>
  542
+	</array>
  543
+	<key>video/x-ms-wmv</key>
  544
+	<array>
  545
+		<string>wmv</string>
  546
+	</array>
  547
+	<key>video/x-ms-wmx</key>
  548
+	<array>
  549
+		<string>wmx</string>
  550
+	</array>
  551
+	<key>video/x-ms.wmp</key>
  552
+	<array>
  553
+		<string>wmp</string>
  554
+	</array>
  555
+	<key>video/x-msvideo</key>
  556
+	<array>
  557
+		<string>avi</string>
  558
+	</array>
  559
+	<key>video/x-sgi-movie</key>
  560
+	<array>
  561
+		<string>movie</string>
  562
+	</array>
  563
+	<key>x-conference/x-cooltalk</key>
  564
+	<array>
  565
+		<string>ice</string>
  566
+	</array>
  567
+</dict>
  568
+</plist>
4  Source/CTCoreAttachment.m
@@ -41,8 +41,8 @@ - (id)initWithContentsOfFile:(NSString *)path {
41 41
     NSString *filePathExt = [path pathExtension];
42 42
 
43 43
     NSString *contentType = nil;
44  
-  //TODO: This won't work on iOS
45  
-    NSDictionary *contentTypes = [NSDictionary dictionaryWithContentsOfFile:CTContentTypesPath];
  44
+    NSString *typesPath = [[NSBundle mainBundle] pathForResource:@"types" ofType:@"plist"];
  45
+    NSDictionary *contentTypes = [NSDictionary dictionaryWithContentsOfFile:typesPath];
46 46
     for (NSString *key in [contentTypes allKeys]) {
47 47
         NSArray *fileExtensions = [contentTypes objectForKey:key];
48 48
         for (NSString *ext in fileExtensions) {

0 notes on commit e44d716

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