diff --git a/mail/base/content/mailCommands.js b/mail/base/content/mailCommands.js index f99c24a1ee67..03142f1f1ed0 100644 --- a/mail/base/content/mailCommands.js +++ b/mail/base/content/mailCommands.js @@ -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 diff --git a/mail/extensions/newsblog/content/toolbar-icon.xul b/mail/extensions/newsblog/content/toolbar-icon.xul index f1de750ec56c..4085b8e4fdbe 100755 --- a/mail/extensions/newsblog/content/toolbar-icon.xul +++ b/mail/extensions/newsblog/content/toolbar-icon.xul @@ -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); + } + } + } + }