mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Bug #258278 --> Forwarding HTML RSS article to an email address results in an empty email message
When forwarding, replying or editing an RSS message, send the http URL for the article instead of trying to load the article contents in the compose window. sr=bienvenu
This commit is contained in:
parent
125996288f
commit
c785d56c18
@ -172,7 +172,6 @@ function ComposeMessage(type, format, folder, messageArray)
|
||||
newsgroup = folder.folderURL;
|
||||
}
|
||||
|
||||
//
|
||||
identity = getIdentityForServer(server);
|
||||
// dump("identity = " + identity + "\n");
|
||||
}
|
||||
@ -235,7 +234,11 @@ function ComposeMessage(type, format, folder, messageArray)
|
||||
if (server)
|
||||
identity = getIdentityForServer(server, hintForIdentity);
|
||||
|
||||
if (type == msgComposeType.Reply || type == msgComposeType.ReplyAll || type == msgComposeType.ForwardInline ||
|
||||
var messageID = hdr.messageId;
|
||||
var messageIDScheme = messageID.split(":")[0];
|
||||
if ((messageIDScheme == 'http' || messageIDScheme == 'https') && "openComposeWindowForRSSArticle" in this)
|
||||
openComposeWindowForRSSArticle(messageID, hdr, type);
|
||||
else if (type == msgComposeType.Reply || type == msgComposeType.ReplyAll || type == msgComposeType.ForwardInline ||
|
||||
type == msgComposeType.ReplyToGroup || type == msgComposeType.ReplyToSender ||
|
||||
type == msgComposeType.ReplyToSenderAndGroup ||
|
||||
type == msgComposeType.Template || type == msgComposeType.Draft)
|
||||
@ -252,7 +255,7 @@ function ComposeMessage(type, format, folder, messageArray)
|
||||
uri += messageUri;
|
||||
}
|
||||
}
|
||||
if (type == msgComposeType.ForwardAsAttachment)
|
||||
if (type == msgComposeType.ForwardAsAttachment && uri)
|
||||
msgComposeService.OpenComposeWindow(null, uri, type, format, identity, msgWindow);
|
||||
}
|
||||
else
|
||||
|
@ -27,6 +27,49 @@
|
||||
var selectedFolders = GetSelectedMsgFolders();
|
||||
openSubscriptionsDialog(selectedFolders[0].server);
|
||||
}
|
||||
|
||||
// Special case attempts to reply/forward/edit as new RSS arrticles
|
||||
// Send the feed article URL instead of trying to load the feed inside of
|
||||
// an iframe. Bug #258278.
|
||||
function openComposeWindowForRSSArticle(messageID, msgHdr, type)
|
||||
{
|
||||
// convert our messageID into a url..
|
||||
var contentBase = messageID.replace("@localhost.localdomain", "");
|
||||
|
||||
var params = Components.classes["@mozilla.org/messengercompose/composeparams;1"]
|
||||
.createInstance(Components.interfaces.nsIMsgComposeParams);
|
||||
if (params)
|
||||
{
|
||||
params.composeFields = Components.classes['@mozilla.org/messengercompose/composefields;1']
|
||||
.createInstance(Components.interfaces.nsIMsgCompFields);
|
||||
if (params.composeFields)
|
||||
{
|
||||
params.composeFields.body = contentBase;
|
||||
var subject = msgHdr.mime2DecodedSubject;
|
||||
if (type == msgComposeType.Reply
|
||||
|| type == msgComposeType.ReplyAll
|
||||
|| type == msgComposeType.ReplyToSender
|
||||
|| type == msgComposeType.ReplyToGroup
|
||||
|| type == msgComposeType.ReplyToSenderAndGroup)
|
||||
subject = 'Re: ' + subject;
|
||||
else if (type == msgComposeType.ForwardInline || type == msgComposeType.ForwardAsAttachment)
|
||||
subject = '[Fwd: ' + subject + ']';
|
||||
params.composeFields.subject = subject;
|
||||
params.composeFields.characterSet = msgHdr.Charset;
|
||||
params.bodyIsLink = true;
|
||||
|
||||
if (msgComposeService) {
|
||||
try {
|
||||
params.identity = msgComposeService.defaultIdentity;
|
||||
}
|
||||
catch (ex) {
|
||||
params.identity = null;
|
||||
}
|
||||
msgComposeService.OpenComposeWindowWithParams(null, params);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Overlay into the folder pane context menu. If you change the id for the menu item, please
|
||||
|
Loading…
Reference in New Issue
Block a user