1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 08:17:59 +01:00

[muttator] fixed attaching files from current directory

This commit is contained in:
Martin Stubenschrott
2008-06-04 05:34:56 +00:00
parent cada00ffe0
commit 3408105f86

View File

@@ -730,20 +730,16 @@ liberator.Mail = function () //{{{
while (args.attachments.length > 0)
{
var url = args.attachments.pop();
// Check if the file really exists
var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
file.initWithPath(url);
var file = liberator.io.getFile(url);
if (!file.exists())
{
liberator.echoerr("Exxx: Could not attach file `" + url + "'", liberator.commandline.FORCE_SINGLELINE);
return;
}
attachment = Components.classes["@mozilla.org/messengercompose/attachment;1"]
.createInstance(Components.interfaces.nsIMsgAttachment);
attachment.url = "file://" + url;
attachment.url = "file://" + file.path;
params.composeFields.addAttachment(attachment);
}
}