Windows: fix outlook attachments not being recognized

This commit is contained in:
Jonathan Jenne 2022-02-28 14:10:53 +01:00
parent e4b95bdddd
commit d742ce8876

View File

@ -280,10 +280,7 @@ Partial Public Class FileDrop
Dim oFormats = pEvent.Data.GetFormats(pAutoConvert).ToList()
Dim oFormatExists = oFormats.Any(Function(format) format = pFormat)
' This does not work with locally created outlook mails
'Dim oFormatExists = pEvent.Data.GetDataPresent(pFormat)
Logger.Debug("Format exists: [{0}]/[{1}]", pFormat, oFormatExists)
Logger.Debug("Format [{0}] exists: [{1}]", pFormat, oFormatExists)
Return oFormatExists
End Function
@ -296,9 +293,11 @@ Partial Public Class FileDrop
End Function
Public Function IsOutlook(e As DragEventArgs) As Boolean
Logger.Debug("Checking for Outlook")
Return CheckFor(e, "FileGroupDescriptor") AndAlso CheckFor(e, "FileContents")
End Function
Public Function IsThunderbird(e As DragEventArgs) As Boolean
Logger.Debug("Checking for Thunderbird")
Return CheckFor(e, "text/x-moz-url") AndAlso CheckFor(e, "FileDrop")
End Function
@ -334,22 +333,24 @@ Partial Public Class FileDrop
#Region "Thunderbird"
Private Function IsOutlookMail(e As DragEventArgs) As Boolean
Logger.Debug("Checking for Outlook Mail")
Return Not IsOutlookAttachment(e) AndAlso CheckFor(e, "RenPrivateSourceFolder")
End Function
Private Function IsOutlookAttachment(e As DragEventArgs) As Boolean
Return IsOutlook(e) AndAlso
CheckFor(e, "RenPrivateItem") AndAlso
CheckFor(e, "ZoneIdentifier")
Logger.Debug("Checking for Outlook Attachment")
Return IsOutlook(e) AndAlso CheckFor(e, "RenPrivateItem")
End Function
#End Region
#Region "Outlook"
Private Function IsThunderbirdMail(e As DragEventArgs) As Boolean
Logger.Debug("Checking for Thunderbird Mail")
Return Not IsThunderbirdAttachment(e)
End Function
Private Function IsThunderbirdAttachment(e As DragEventArgs) As Boolean
Logger.Debug("Checking for Thunderbird Attachment")
Return IsThunderbird(e) AndAlso
CheckFor(e, "text/x-moz-url-data") AndAlso
CheckFor(e, "text/x-moz-url-desc")