mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 10:08:00 +01:00
[muttator] fixed attaching files from current directory
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user