blob: c5b586f5d32b4692197f55163bfd6ea257a98c1c (
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
//
// MCNNTPPostOperation.cpp
// mailcore2
//
// Created by Daryle Walker on 2/21/16.
// Copyright © 2016 MailCore. All rights reserved.
//
#include "MCNNTPPostOperation.h"
#include "MCNNTPAsyncSession.h"
#include "MCNNTPSession.h"
using namespace mailcore;
NNTPPostOperation::NNTPPostOperation()
{
mMessageData = NULL;
mMessageFilepath = NULL;
}
NNTPPostOperation::~NNTPPostOperation()
{
MC_SAFE_RELEASE(mMessageFilepath);
MC_SAFE_RELEASE(mMessageData);
}
void NNTPPostOperation::setMessageData(Data * data)
{
MC_SAFE_REPLACE_RETAIN(Data, mMessageData, data);
}
Data * NNTPPostOperation::messageData()
{
return mMessageData;
}
void NNTPPostOperation::setMessageFilepath(String * path)
{
MC_SAFE_REPLACE_RETAIN(String, mMessageFilepath, path);
}
String * NNTPPostOperation::messageFilepath()
{
return mMessageFilepath;
}
void NNTPPostOperation::main()
{
ErrorCode error;
if (mMessageFilepath != NULL) {
session()->session()->postMessage(mMessageFilepath, this, &error);
}
else {
session()->session()->postMessage(mMessageData, this, &error);
}
setError(error);
}
|