mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 15:58:39 +09:00
Merge remote-tracking branch 'origin/tracking' into custom
This commit is contained in:
commit
a1608dd4c7
2 changed files with 14 additions and 8 deletions
|
|
@ -190,7 +190,6 @@ public:
|
|||
|
||||
bool IsClosed()
|
||||
{
|
||||
MutexAutoLock lock(mMutex);
|
||||
return ReadyState() == CLOSED;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#include "prmem.h"
|
||||
#include "nsMsgSend.h"
|
||||
#include "nsIIOService.h"
|
||||
#include "nsIHttpProtocolHandler.h"
|
||||
#include "nsIXULAppInfo.h"
|
||||
#include "nsMailHeaders.h"
|
||||
#include "nsMsgI18N.h"
|
||||
#include "nsINntpService.h"
|
||||
|
|
@ -357,14 +357,21 @@ nsresult mime_generate_headers(nsIMsgCompFields *fields,
|
|||
finalHeaders->SetRawHeader(HEADER_X_MOZILLA_DRAFT_INFO, draftInfo, nullptr);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIHttpProtocolHandler> pHTTPHandler = do_GetService(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "http", &rv);
|
||||
if (NS_SUCCEEDED(rv) && pHTTPHandler)
|
||||
{
|
||||
nsAutoCString userAgentString;
|
||||
pHTTPHandler->GetUserAgent(userAgentString);
|
||||
nsCOMPtr<nsIXULAppInfo> appInfo = do_GetService("@mozilla.org/xre/app-info;1");
|
||||
if (appInfo) {
|
||||
nsAutoCString userAgentString;
|
||||
nsAutoCString userAgentName;
|
||||
nsAutoCString userAgentVersion;
|
||||
appInfo->GetName(userAgentName);
|
||||
appInfo->GetVersion(userAgentVersion);
|
||||
if (!userAgentName.IsEmpty() && !userAgentVersion.IsEmpty()) {
|
||||
userAgentString += userAgentName;
|
||||
userAgentString += '/';
|
||||
userAgentString += userAgentVersion;
|
||||
}
|
||||
|
||||
if (!userAgentString.IsEmpty())
|
||||
finalHeaders->SetUnstructuredHeader("User-Agent",
|
||||
finalHeaders->SetUnstructuredHeader("X-Mailer",
|
||||
NS_ConvertUTF8toUTF16(userAgentString));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue