1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 13:52:26 +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) while (args.attachments.length > 0)
{ {
var url = args.attachments.pop(); var url = args.attachments.pop();
var file = liberator.io.getFile(url);
// Check if the file really exists
var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
file.initWithPath(url);
if (!file.exists()) if (!file.exists())
{ {
liberator.echoerr("Exxx: Could not attach file `" + url + "'", liberator.commandline.FORCE_SINGLELINE); liberator.echoerr("Exxx: Could not attach file `" + url + "'", liberator.commandline.FORCE_SINGLELINE);
return; return;
} }
attachment = Components.classes["@mozilla.org/messengercompose/attachment;1"] attachment = Components.classes["@mozilla.org/messengercompose/attachment;1"]
.createInstance(Components.interfaces.nsIMsgAttachment); .createInstance(Components.interfaces.nsIMsgAttachment);
attachment.url = "file://" + url; attachment.url = "file://" + file.path;
params.composeFields.addAttachment(attachment); params.composeFields.addAttachment(attachment);
} }
} }