Merge remote-tracking branch 'origin/master' into custom

This commit is contained in:
Roy Tam 2019-12-10 10:51:12 +08:00
commit 39b5cb2fd9
6 changed files with 38 additions and 20 deletions

View file

@ -1136,6 +1136,8 @@ nsresult nsMsgDBView::UpdateDisplayMessage(nsMsgViewIndex viewPosition)
NS_ENSURE_SUCCESS(rv,rv);
nsString subject;
if (viewPosition >= (nsMsgViewIndex)m_flags.Length())
return NS_MSG_INVALID_DBVIEW_INDEX;
FetchSubject(msgHdr, m_flags[viewPosition], subject);
nsCString keywords;
@ -1148,6 +1150,8 @@ nsresult nsMsgDBView::UpdateDisplayMessage(nsMsgViewIndex viewPosition)
if (folder)
{
if (viewPosition >= (nsMsgViewIndex)m_keys.Length())
return NS_MSG_INVALID_DBVIEW_INDEX;
rv = folder->SetLastMessageLoaded(m_keys[viewPosition]);
NS_ENSURE_SUCCESS(rv,rv);
}
@ -1175,6 +1179,8 @@ NS_IMETHODIMP nsMsgDBView::LoadMessageByViewIndex(nsMsgViewIndex aViewIndex)
nsCOMPtr<nsIMessenger> messenger (do_QueryReferent(mMessengerWeak));
NS_ENSURE_TRUE(messenger, NS_ERROR_FAILURE);
messenger->OpenURL(uri);
if (aViewIndex >= (nsMsgViewIndex)m_keys.Length())
return NS_MSG_INVALID_DBVIEW_INDEX;
m_currentlyDisplayedMsgKey = m_keys[aViewIndex];
m_currentlyDisplayedMsgUri = uri;
m_currentlyDisplayedViewIndex = aViewIndex;

View file

@ -28,6 +28,9 @@ nsMsgLocalStoreUtils::AddDirectorySeparator(nsIFile *path)
bool
nsMsgLocalStoreUtils::nsShouldIgnoreFile(nsAString& name)
{
if (name.IsEmpty())
return true;
char16_t firstChar = name.First();
if (firstChar == '.' || firstChar == '#' ||
name.CharAt(name.Length() - 1) == '~')

View file

@ -725,21 +725,20 @@ mime_find_class (const char *content_type, MimeHeaders *hdrs,
else if (!PL_strcasecmp(content_type, APPLICATION_XPKCS7_MIME)
|| !PL_strcasecmp(content_type, APPLICATION_PKCS7_MIME)) {
if (Preferences::GetBool("mailnews.p7m_subparts_external", false) &&
opts->is_child) {
// We do not allow encrypted parts except as top level.
// Allowing them would leak the plain text in case the part is
// cleverly hidden and the decrypted content gets included in
// replies and forwards.
clazz = (MimeObjectClass *)&mimeSuppressedCryptoClass;
return clazz;
}
char *ct = (hdrs ? MimeHeaders_get(hdrs, HEADER_CONTENT_TYPE,
false, false)
: nullptr);
char *st = (ct ? MimeHeaders_get_parameter(ct, "smime-type", NULL, NULL)
: nullptr);
if (Preferences::GetBool("mailnews.p7m_subparts_external", true) &&
opts->is_child) {
// We do not allow encrypted parts except as top level.
// Allowing them would leak the plain text in case the part is
// cleverly hidden and the decrypted content gets included in
// replies and forwards.
clazz = (MimeObjectClass *)&mimeSuppressedCryptoClass;
} else {
char *ct =
hdrs ? MimeHeaders_get(hdrs, HEADER_CONTENT_TYPE, false, false)
: nullptr;
char *st =
ct ? MimeHeaders_get_parameter(ct, "smime-type", nullptr, nullptr)
: nullptr;
/* by default, assume that it is an encrypted message */
clazz = (MimeObjectClass *)&mimeEncryptedCMSClass;
@ -747,9 +746,8 @@ mime_find_class (const char *content_type, MimeHeaders *hdrs,
/* if the smime-type parameter says that it's a certs-only or
compressed file, then show it as an attachment, however
(MimeEncryptedCMS doesn't handle these correctly) */
if (st &&
(!PL_strcasecmp(st, "certs-only") ||
!PL_strcasecmp(st, "compressed-data")))
if (st && (!PL_strcasecmp(st, "certs-only") ||
!PL_strcasecmp(st, "compressed-data")))
clazz = (MimeObjectClass *)&mimeExternalObjectClass;
else {
/* look at the file extension... less reliable, but still covered
@ -763,14 +761,14 @@ mime_find_class (const char *content_type, MimeHeaders *hdrs,
prefBranch->GetBoolPref("mailnews.p7m_external", &p7mExternal);
if (suf &&
((!PL_strcasecmp(suf, ".p7m") && p7mExternal) ||
!PL_strcasecmp(suf, ".p7c") ||
!PL_strcasecmp(suf, ".p7z")))
!PL_strcasecmp(suf, ".p7c") || !PL_strcasecmp(suf, ".p7z")))
clazz = (MimeObjectClass *)&mimeExternalObjectClass;
}
PR_Free(name);
}
PR_Free(st);
PR_Free(ct);
}
}
#endif
/* A few types which occur in the real world and which we would otherwise

View file

@ -282,6 +282,10 @@ MimeMultipartAlternative_parse_eof (MimeObject *obj, bool abort_p)
static int
MimeMultipartAlternative_create_child(MimeObject *obj)
{
if (obj->options) {
obj->options->is_child = true;
}
MimeMultipart *mult = (MimeMultipart *) obj;
MimeMultipartAlternative *malt = (MimeMultipartAlternative *) obj;

View file

@ -90,6 +90,9 @@ MimeSunAttachment_check_boundary(MimeObject *obj, const char *line,
static int
MimeSunAttachment_create_child(MimeObject *obj)
{
if (obj->options) {
obj->options->is_child = true;
}
MimeMultipart *mult = (MimeMultipart *) obj;
int status = 0;

View file

@ -18,6 +18,10 @@ else
ifeq (WINNT,$(OS_ARCH))
cd $(DIST); $(CYGWIN_WRAPPER) 7z a -t7z -m0=lzma2 -mx=9 -aoa -bb3 $(PKG_BASENAME).7z $(MOZ_PKG_DIR)
else
# Other platforms such as Linux need the Package routine to spawn a pre-complete file
# Windows does not require this because it is dependent on generating the NSIS
# Installer which has its own call to generate the precomplete file
cd $(DIST)/$(MOZ_PKG_DIR); $(CREATE_PRECOMPLETE_CMD)
cd $(DIST); XZ_OPT=-9e $(TAR) cfJv $(PKG_BASENAME).tar.xz $(MOZ_PKG_DIR)
endif
endif