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