Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions RNMail/RNMail.m
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,16 @@ + (BOOL)requiresMainQueueSetup
mimeType = @"application/zip";
} else if ([attachmentType isEqualToString:@"text"]) {
mimeType = @"text/*";
} else if ([attachmentType isEqualToString:@"mp3"]) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at this point, it might be worth using a switch statement here. @adamski you wanna tackle that now?

i'm ok with shipping this as is too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Objective-C (like C) only supports integer values for switch statements, so not possible I'm afraid, although there are some workarounds that can look similar. I think its simpler to leave it as is.

mimeType = @"audio/mpeg";
} else if ([attachmentType isEqualToString:@"wav"]) {
mimeType = @"audio/wav";
} else if ([attachmentType isEqualToString:@"aiff"]) {
mimeType = @"audio/aiff";
} else if ([attachmentType isEqualToString:@"flac"]) {
mimeType = @"audio/flac";
} else if ([attachmentType isEqualToString:@"ogg"]) {
mimeType = @"audio/ogg";
}

// Add attachment
Expand Down