| 203 | } |
| 204 | |
| 205 | static struct mailmime * get_plain_text_part(MessageBuilder * builder, |
| 206 | const char * mime_type, const char * charset, const char * content_id, |
| 207 | const char * description, |
| 208 | const char * text, size_t length, clist * contentTypeParameters, bool forEncryption) |
| 209 | { |
| 210 | bool needsQuotedPrintable; |
| 211 | int mechanism; |
| 212 | |
| 213 | needsQuotedPrintable = false; |
| 214 | if (forEncryption) { |
| 215 | needsQuotedPrintable = true; |
| 216 | } |
| 217 | if (!needsQuotedPrintable) { |
| 218 | for(size_t i = 0 ; i < length ; i ++) { |
| 219 | if ((text[i] & (1 << 7)) != 0) { |
| 220 | needsQuotedPrintable = true; |
| 221 | break; |
| 222 | } |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | mechanism = MAILMIME_MECHANISM_7BIT; |
| 227 | if (needsQuotedPrintable) { |
| 228 | mechanism = MAILMIME_MECHANISM_QUOTED_PRINTABLE; |
| 229 | } |
| 230 | return get_text_part(builder, mime_type, charset, content_id, description, text, length, mechanism, contentTypeParameters); |
| 231 | } |
| 232 | |
| 233 | static struct mailmime * get_other_text_part(MessageBuilder * builder, |
| 234 | const char * mime_type, const char * charset, const char * content_id, |
no test coverage detected