зеркало из https://github.com/mozilla/gecko-dev.git
Add some basic status messages for sending a message.
This commit is contained in:
Родитель
fa0ee6edae
Коммит
b575970341
|
@ -25,7 +25,7 @@
|
||||||
#include "nsIMsgHeaderParser.h"
|
#include "nsIMsgHeaderParser.h"
|
||||||
#include "nsFileStream.h"
|
#include "nsFileStream.h"
|
||||||
#include "nsIMsgMailNewsUrl.h"
|
#include "nsIMsgMailNewsUrl.h"
|
||||||
|
#include "nsMsgComposeStringBundle.h"
|
||||||
#include "nsMsgBaseCID.h"
|
#include "nsMsgBaseCID.h"
|
||||||
|
|
||||||
#include "prtime.h"
|
#include "prtime.h"
|
||||||
|
@ -340,6 +340,22 @@ PRInt32 nsSmtpProtocol::ReadLine(nsIInputStream * inputStream, PRUint32 length,
|
||||||
return numBytesRead;
|
return numBytesRead;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void nsSmtpProtocol::UpdateStatus(PRInt32 aStatusID)
|
||||||
|
{
|
||||||
|
if (m_statusFeedback)
|
||||||
|
{
|
||||||
|
PRUnichar * statusString = ComposeGetStringByID(aStatusID);
|
||||||
|
UpdateStatusWithString(statusString);
|
||||||
|
nsCRT::free(statusString);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void nsSmtpProtocol::UpdateStatusWithString(PRUnichar * aStatusString)
|
||||||
|
{
|
||||||
|
if (m_statusFeedback && aStatusString)
|
||||||
|
m_statusFeedback->ShowStatusString(aStatusString);
|
||||||
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Begin protocol state machine functions...
|
// Begin protocol state machine functions...
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -970,9 +986,7 @@ PRInt32 nsSmtpProtocol::SendDataResponse()
|
||||||
m_nextState = SMTP_SEND_POST_DATA;
|
m_nextState = SMTP_SEND_POST_DATA;
|
||||||
ClearFlag(SMTP_PAUSE_FOR_READ); /* send data directly */
|
ClearFlag(SMTP_PAUSE_FOR_READ); /* send data directly */
|
||||||
|
|
||||||
#ifdef UNREADY_CODE
|
UpdateStatus(SMTP_DELIV_MAIL);
|
||||||
NET_Progress(CE_WINDOW_ID, XP_GetString(MK_MSG_DELIV_MAIL));
|
|
||||||
#endif /* UNREADY_CODE */
|
|
||||||
|
|
||||||
#ifdef UNREADY_CODE
|
#ifdef UNREADY_CODE
|
||||||
/* get the size of the message */
|
/* get the size of the message */
|
||||||
|
@ -1114,13 +1128,10 @@ PRInt32 nsSmtpProtocol::SendMessageInFile()
|
||||||
// always issue a '.' and CRLF when we are done...
|
// always issue a '.' and CRLF when we are done...
|
||||||
nsCOMPtr<nsIURI> url = do_QueryInterface(m_runningURL);
|
nsCOMPtr<nsIURI> url = do_QueryInterface(m_runningURL);
|
||||||
SendData(url, CRLF "." CRLF);
|
SendData(url, CRLF "." CRLF);
|
||||||
#ifdef UNREADY_CODE
|
UpdateStatus(SMTP_MESSAGE_SENT_WAITING_MAIL_REPLY);
|
||||||
NET_Progress(CE_WINDOW_ID,
|
m_nextState = SMTP_RESPONSE;
|
||||||
XP_GetString(XP_MESSAGE_SENT_WAITING_MAIL_REPLY));
|
m_nextStateAfterResponse = SMTP_SEND_MESSAGE_RESPONSE;
|
||||||
#endif /* UNREADY_CODE */
|
return(0);
|
||||||
m_nextState = SMTP_RESPONSE;
|
|
||||||
m_nextStateAfterResponse = SMTP_SEND_MESSAGE_RESPONSE;
|
|
||||||
return(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PRInt32 nsSmtpProtocol::SendPostData()
|
PRInt32 nsSmtpProtocol::SendPostData()
|
||||||
|
@ -1179,10 +1190,9 @@ PRInt32 nsSmtpProtocol::SendMessageResponse()
|
||||||
return(MK_ERROR_SENDING_MESSAGE);
|
return(MK_ERROR_SENDING_MESSAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef UNREADY_CODE
|
UpdateStatus(SMTP_PROGRESS_MAILSENT);
|
||||||
NET_Progress(CE_WINDOW_ID, XP_GetString(XP_PROGRESS_MAILSENT));
|
|
||||||
#endif
|
/* else */
|
||||||
/* else */
|
|
||||||
nsCOMPtr<nsIURI> url = do_QueryInterface(m_runningURL);
|
nsCOMPtr<nsIURI> url = do_QueryInterface(m_runningURL);
|
||||||
SendData(url, "quit"CRLF); // send a quit command to close the connection with the server.
|
SendData(url, "quit"CRLF); // send a quit command to close the connection with the server.
|
||||||
m_nextState = SMTP_DONE;
|
m_nextState = SMTP_DONE;
|
||||||
|
|
|
@ -126,6 +126,9 @@ private:
|
||||||
|
|
||||||
PRInt32 ReadLine(nsIInputStream * inputStream, PRUint32 length, char ** line);
|
PRInt32 ReadLine(nsIInputStream * inputStream, PRUint32 length, char ** line);
|
||||||
|
|
||||||
|
void UpdateStatus(PRInt32 aStatusID);
|
||||||
|
void UpdateStatusWithString(PRUnichar * aStatusString);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Protocol Methods --> This protocol is state driven so each protocol method is
|
// Protocol Methods --> This protocol is state driven so each protocol method is
|
||||||
// designed to re-act to the current "state". I've attempted to
|
// designed to re-act to the current "state". I've attempted to
|
||||||
|
|
Загрузка…
Ссылка в новой задаче