Bug #65900 --> when offline and we don't have a message body, clear the header ovleray
r/sr=sspitzer git-svn-id: svn://10.0.0.236/trunk@100956 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -35,10 +35,20 @@ interface nsIAuthPrompt;
|
||||
* This interface can be used to set data specific to a window.
|
||||
*/
|
||||
|
||||
/* nsIMsgMessagePaneController is used to control the visiblity of the message pane
|
||||
including the header overlay and the body.
|
||||
*/
|
||||
|
||||
[scriptable, uuid(923DE63D-EEB9-4574-850B-322C1A4667ED)]
|
||||
interface nsIMsgMessagePaneController : nsISupports {
|
||||
void clearMsgPane();
|
||||
};
|
||||
|
||||
|
||||
[scriptable, uuid(BD85A416-5433-11d3-8AC5-0060B0FC04D2)]
|
||||
interface nsIMsgWindow : nsISupports {
|
||||
|
||||
attribute nsIMsgMessagePaneController messagePaneController;
|
||||
attribute nsIMsgStatusFeedback statusFeedback;
|
||||
attribute nsIMsgHeaderSink msgHeaderSink;
|
||||
attribute nsITransactionManager transactionManager;
|
||||
|
||||
@@ -27,6 +27,7 @@ var gOfflineManager;
|
||||
function MailOfflineStateChanged(goingOffline)
|
||||
{
|
||||
// tweak any mail UI here that needs to change when we go offline or come back online
|
||||
gFolderJustSwitched = true;
|
||||
}
|
||||
|
||||
function MsgSettingsOffline()
|
||||
|
||||
@@ -31,6 +31,7 @@ var msgWindowContractID = "@mozilla.org/messenger/msgwindow;1";
|
||||
var messenger;
|
||||
var pref;
|
||||
var statusFeedback;
|
||||
var messagePaneController;
|
||||
var msgWindow;
|
||||
|
||||
var msgComposeService;
|
||||
@@ -165,6 +166,7 @@ function CreateMailWindowGlobals()
|
||||
|
||||
function InitMsgWindow()
|
||||
{
|
||||
msgWindow.messagePaneController = new nsMessagePaneController();
|
||||
msgWindow.statusFeedback = statusFeedback;
|
||||
msgWindow.msgHeaderSink = messageHeaderSink;
|
||||
msgWindow.SetDOMWindow(window);
|
||||
@@ -393,6 +395,25 @@ nsMsgWindowCommands.prototype =
|
||||
}
|
||||
}
|
||||
|
||||
function nsMessagePaneController()
|
||||
{
|
||||
}
|
||||
|
||||
nsMessagePaneController.prototype =
|
||||
{
|
||||
QueryInterface : function(iid)
|
||||
{
|
||||
if(iid.equals(Components.interfaces.nsIMsgMessagePaneController))
|
||||
return this;
|
||||
throw Components.results.NS_NOINTERFACE;
|
||||
return null;
|
||||
},
|
||||
clearMsgPane: function()
|
||||
{
|
||||
ClearMessagePane();
|
||||
}
|
||||
}
|
||||
|
||||
function StopUrls()
|
||||
{
|
||||
msgWindow.StopUrls();
|
||||
|
||||
@@ -138,8 +138,7 @@ NS_IMETHODIMP nsMsgWindow::SelectMessage(const char *messageUri)
|
||||
NS_IMETHODIMP nsMsgWindow::CloseWindow()
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
nsCOMPtr<nsIURILoader> dispatcher =
|
||||
do_GetService(NS_URI_LOADER_CONTRACTID, &rv);
|
||||
nsCOMPtr<nsIURILoader> dispatcher = do_GetService(NS_URI_LOADER_CONTRACTID, &rv);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
rv = dispatcher->UnRegisterContentListener(this);
|
||||
|
||||
@@ -149,6 +148,8 @@ NS_IMETHODIMP nsMsgWindow::CloseWindow()
|
||||
if (mStatusFeedback)
|
||||
mStatusFeedback->CloseWindow();
|
||||
|
||||
mMsgPaneController = nsnull;
|
||||
|
||||
StopUrls();
|
||||
|
||||
nsCOMPtr<nsIDocShell> rootShell(do_QueryReferent(mRootDocShellWeak));
|
||||
@@ -192,6 +193,21 @@ NS_IMETHODIMP nsMsgWindow::SetStatusFeedback(nsIMsgStatusFeedback * aStatusFeedb
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgWindow::GetMessagePaneController(nsIMsgMessagePaneController * * aMsgPaneController)
|
||||
{
|
||||
NS_ENSURE_ARG(aMsgPaneController);
|
||||
|
||||
*aMsgPaneController = mMsgPaneController;
|
||||
NS_IF_ADDREF(*aMsgPaneController);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgWindow::SetMessagePaneController(nsIMsgMessagePaneController * aMsgPaneController)
|
||||
{
|
||||
mMsgPaneController = aMsgPaneController;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgWindow::GetMsgHeaderSink(nsIMsgHeaderSink * *aMsgHdrSink)
|
||||
{
|
||||
if(!aMsgHdrSink)
|
||||
@@ -517,6 +533,9 @@ nsMsgWindow::DisplayHTMLInMessagePane(const PRUnichar *title, const PRUnichar *b
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
if (mMsgPaneController)
|
||||
mMsgPaneController->ClearMsgPane();
|
||||
|
||||
nsString htmlStr;
|
||||
htmlStr.Append(NS_LITERAL_STRING("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"></head><body>").get());
|
||||
htmlStr.Append(body);
|
||||
|
||||
Reference in New Issue
Block a user