- tny_mime_part_decode_to_stream_async (mime_part, TNY_STREAM (temp_stream),
- on_decode_to_stream_async_handler,
- NULL,
- helper);
+ decode_in_provider = FALSE;
+ mgr = modest_runtime_get_account_mgr ();
+ account = modest_window_get_active_account (MODEST_WINDOW (window));
+ if (modest_account_mgr_account_is_multimailbox (mgr, account, &protocol)) {
+ if (MODEST_IS_ACCOUNT_PROTOCOL (protocol)) {
+ decode_in_provider =
+ modest_account_protocol_decode_part_to_stream_async (
+ MODEST_ACCOUNT_PROTOCOL (protocol),
+ mime_part,
+ TNY_STREAM (temp_stream),
+ on_decode_to_stream_async_handler,
+ NULL,
+ helper);
+ }
+ }
+
+ if (!decode_in_provider)
+ tny_mime_part_decode_to_stream_async (mime_part, TNY_STREAM (temp_stream),
+ on_decode_to_stream_async_handler,
+ NULL,
+ helper);