aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/async/imap/MCIMAPFetchContentOperation.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/async/imap/MCIMAPFetchContentOperation.cc')
-rw-r--r--src/async/imap/MCIMAPFetchContentOperation.cc27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/async/imap/MCIMAPFetchContentOperation.cc b/src/async/imap/MCIMAPFetchContentOperation.cc
index de3b911e..049ac8a7 100644
--- a/src/async/imap/MCIMAPFetchContentOperation.cc
+++ b/src/async/imap/MCIMAPFetchContentOperation.cc
@@ -16,6 +16,7 @@ using namespace mailcore;
IMAPFetchContentOperation::IMAPFetchContentOperation()
{
mUid = 0;
+ mNumber = 0;
mPartID = NULL;
mEncoding = Encoding7Bit;
mData = NULL;
@@ -37,6 +38,16 @@ uint32_t IMAPFetchContentOperation::uid()
return mUid;
}
+void IMAPFetchContentOperation::setNumber(uint32_t value)
+{
+ mNumber = value;
+}
+
+uint32_t IMAPFetchContentOperation::number()
+{
+ return mNumber;
+}
+
void IMAPFetchContentOperation::setPartID(String * partID)
{
MC_SAFE_REPLACE_COPY(String, mPartID, partID);
@@ -65,11 +76,21 @@ Data * IMAPFetchContentOperation::data()
void IMAPFetchContentOperation::main()
{
ErrorCode error;
- if (mPartID != NULL) {
- mData = session()->session()->fetchMessageAttachmentByUID(folder(), mUid, mPartID, mEncoding, this, &error);
+ if (mUid != 0) {
+ if (mPartID != NULL) {
+ mData = session()->session()->fetchMessageAttachmentByUID(folder(), mUid, mPartID, mEncoding, this, &error);
+ }
+ else {
+ mData = session()->session()->fetchMessageByUID(folder(), mUid, this, &error);
+ }
}
else {
- mData = session()->session()->fetchMessageByUID(folder(), mUid, this, &error);
+ if (mPartID != NULL) {
+ mData = session()->session()->fetchMessageAttachmentByNumber(folder(), mNumber, mPartID, mEncoding, this, &error);
+ }
+ else {
+ mData = session()->session()->fetchMessageByNumber(folder(), mNumber, this, &error);
+ }
}
MC_SAFE_RETAIN(mData);
setError(error);