diff options
Diffstat (limited to 'mailnews/imap/src')
-rw-r--r-- | mailnews/imap/src/nsImapProtocol.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/mailnews/imap/src/nsImapProtocol.cpp b/mailnews/imap/src/nsImapProtocol.cpp index 9d943f7ec..dee4ff169 100644 --- a/mailnews/imap/src/nsImapProtocol.cpp +++ b/mailnews/imap/src/nsImapProtocol.cpp @@ -5418,14 +5418,6 @@ void nsImapProtocol::Capability() nsresult rv = SendData(command.get()); if (NS_SUCCEEDED(rv)) ParseIMAPandCheckForNewMail(); - if (!gUseLiteralPlus) - { - eIMAPCapabilityFlags capabilityFlag = GetServerStateParser().GetCapabilityFlag(); - if (capabilityFlag & kLiteralPlusCapability) - { - GetServerStateParser().SetCapabilityFlag(capabilityFlag & ~kLiteralPlusCapability); - } - } } void nsImapProtocol::ID() @@ -6091,8 +6083,6 @@ void nsImapProtocol::UploadMessageFromFile (nsIFile* file, nsresult rv; bool eof = false; nsCString flagString; - bool hasLiteralPlus = (GetServerStateParser().GetCapabilityFlag() & - kLiteralPlusCapability); nsCOMPtr <nsIInputStream> fileInputStream; @@ -6155,7 +6145,13 @@ void nsImapProtocol::UploadMessageFromFile (nsIFile* file, rv = NS_NewLocalFileInputStream(getter_AddRefs(fileInputStream), file); if (NS_FAILED(rv) || !fileInputStream) goto done; command.AppendInt((int32_t)fileSize); - if (hasLiteralPlus) + + // Set useLiteralPlus to true if server has capability LITERAL+ and + // LITERAL+ useage is enabled in the config editor, + // i.e., "mail.imap.use_literal_plus" = true. + bool useLiteralPlus = (GetServerStateParser().GetCapabilityFlag() & + kLiteralPlusCapability) && gUseLiteralPlus; + if (useLiteralPlus) command.Append("+}" CRLF); else command.Append("}" CRLF); @@ -6163,7 +6159,7 @@ void nsImapProtocol::UploadMessageFromFile (nsIFile* file, rv = SendData(command.get()); if (NS_FAILED(rv)) goto done; - if (!hasLiteralPlus) + if (!useLiteralPlus) ParseIMAPandCheckForNewMail(); totalSize = fileSize; |