aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/async/imap/MCIMAPFetchNamespaceOperation.cc
blob: 6851130d04193c4d52cec1ae2878bc5d6a5d296d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//
//  IMAPFetchNamespaceOperation.cc
//  mailcore2
//
//  Created by DINH Viêt Hoà on 1/12/13.
//  Copyright (c) 2013 MailCore. All rights reserved.
//

#include "MCIMAPFetchNamespaceOperation.h"

#include "MCIMAPSession.h"
#include "MCIMAPAsyncConnection.h"

using namespace mailcore;

IMAPFetchNamespaceOperation::IMAPFetchNamespaceOperation()
{
    mNamespaces = NULL;
}

IMAPFetchNamespaceOperation::~IMAPFetchNamespaceOperation()
{
    MC_SAFE_RELEASE(mNamespaces);
}

void IMAPFetchNamespaceOperation::main()
{
    ErrorCode error;
    mNamespaces = session()->session()->fetchNamespace(&error);
    setError(error);
    MC_SAFE_RETAIN(mNamespaces);
}

HashMap * IMAPFetchNamespaceOperation::namespaces()
{
    return mNamespaces;
}