TF-3416 Handle download attachment in EML previewer on mobile
This commit is contained in:
@@ -2059,6 +2059,8 @@ class SingleEmailController extends BaseController with AppLoaderMixin {
|
||||
emlPreviewer: emlPreviewer,
|
||||
onMailtoDelegateAction: openMailToLink,
|
||||
onPreviewEMLDelegateAction: (uri) => _openEMLPreviewer(context, uri),
|
||||
onDownloadAttachmentDelegateAction: (uri) =>
|
||||
_downloadAttachmentInEMLPreview(context, uri),
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -2069,13 +2071,23 @@ class SingleEmailController extends BaseController with AppLoaderMixin {
|
||||
log('SingleEmailController::_openEMLPreviewer:uri = $uri');
|
||||
if (uri == null) return;
|
||||
|
||||
final blobId = uri.authority;
|
||||
final blobId = uri.path;
|
||||
log('SingleEmailController::_openEMLPreviewer:blobId = $blobId');
|
||||
if (blobId.isEmpty) return;
|
||||
|
||||
previewEMLFileAction(Id(blobId), AppLocalizations.of(context));
|
||||
}
|
||||
|
||||
Future<void> _downloadAttachmentInEMLPreview(BuildContext context, Uri? uri) async {
|
||||
log('SingleEmailController::_downloadAttachmentInEMLPreview:uri = $uri');
|
||||
if (uri == null) return;
|
||||
|
||||
final attachment = EmailUtils.parsingAttachmentByUri(uri);
|
||||
if (attachment == null) return;
|
||||
|
||||
handleDownloadAttachmentAction(context, attachment);
|
||||
}
|
||||
|
||||
void handleMailToAttendees(CalendarOrganizer? organizer, List<CalendarAttendee>? attendees) {
|
||||
final listEmailAddressAttendees = attendees
|
||||
?.map((attendee) => EmailAddress(attendee.name?.name, attendee.mailto?.mailAddress.value))
|
||||
|
||||
Reference in New Issue
Block a user