Commit 46ddfdee authored by Martin Straka's avatar Martin Straka

Added send sms task and change password task

parent 0cae7fe7
......@@ -120,11 +120,13 @@ SOURCES += \
src/sqlite/message_db.cpp \
src/worker/pool.cpp \
src/worker/task.cpp \
src/worker/task_change_password.cpp \
src/worker/task_download_account_info.cpp \
src/worker/task_download_delivery_info.cpp \
src/worker/task_download_message.cpp \
src/worker/task_download_message_list.cpp \
src/worker/task_keep_alive.cpp
src/worker/task_keep_alive.cpp \
src/worker/task_send_sms.cpp
HEADERS += \
src/accounts.h \
......@@ -165,11 +167,13 @@ HEADERS += \
src/sqlite/message_db.h \
src/worker/pool.h \
src/worker/task.h \
src/worker/task_change_password.h \
src/worker/task_download_account_info.h \
src/worker/task_download_delivery_info.h \
src/worker/task_download_message.h \
src/worker/task_download_message_list.h \
src/worker/task_keep_alive.h
src/worker/task_keep_alive.h \
src/worker/task_send_sms.h
android {
SOURCES += \
......
......@@ -82,6 +82,8 @@
/* ISDS OTP login indetificators */
#define OTP_TYPE_TOTP "TOTP"
#define OTP_TYPE_HOTP "HOTP"
#define OTP_NO_OTP "noOTP"
/*!
* @brief Maximum length of message list to be downloaded.
......
......@@ -27,12 +27,15 @@
#include "src/models/accountmodel.h"
#include "src/models/messagemodel.h"
#include "src/net/isds_wrapper.h"
#include "src/net/xml_layer.h"
#include "src/settings.h"
#include "src/worker/task_change_password.h"
#include "src/worker/task_download_account_info.h"
#include "src/worker/task_download_delivery_info.h"
#include "src/worker/task_download_message.h"
#include "src/worker/task_download_message_list.h"
#include "src/worker/task_keep_alive.h"
#include "src/worker/task_send_sms.h"
IsdsWrapper::IsdsWrapper(QObject *parent)
: QObject(parent),
......@@ -302,7 +305,10 @@ bool IsdsWrapper::changePassword(const QString &userName,
{
qDebug("%s()", __func__);
bool success = false;
QString errTxt = tr("Wrong username");
QString oldPwd = m_isdsSession.isdsCtxMap[userName].password;
if (userName.isEmpty()) {
Dialogues::errorMessage(Dialogues::CRITICAL,
......@@ -343,7 +349,15 @@ bool IsdsWrapper::changePassword(const QString &userName,
return false;
}
if (!m_xmlLayer.isdsSendSMS(m_isdsSession.isdsCtxMap[userName])) {
TaskSendSMS *taskSMS;
taskSMS = new (std::nothrow) TaskSendSMS(
m_isdsSession.isdsCtxMap[userName], &m_netLayer);
taskSMS->setAutoDelete(false);
m_workPool.runSingle(taskSMS);
success = TaskSendSMS::DL_SUCCESS == taskSMS->m_result;
delete taskSMS;
if (!success) {
Dialogues::errorMessage(Dialogues::CRITICAL,
tr("Change password: %1").arg(userName),
tr("Failed to send SMS code for username '%1'.").arg(userName),
......@@ -362,6 +376,15 @@ bool IsdsWrapper::changePassword(const QString &userName,
return false;
}
TaskChangePassword *task;
task = new (std::nothrow) TaskChangePassword(
m_isdsSession.isdsCtxMap[userName], &m_netLayer, OTP_TYPE_TOTP,
oldPwd, newPwd);
task->setAutoDelete(false);
m_workPool.runSingle(task);
success = TaskChangePassword::DL_SUCCESS == task->m_result;
delete task;
} else if (m_isdsSession.isdsCtxMap[userName].login_method == USERNAME_PWD_HOTP) {
QString text = Dialogues::getText(Q_NULLPTR,
tr("Security code: %1").arg(userName),
......@@ -373,13 +396,29 @@ bool IsdsWrapper::changePassword(const QString &userName,
} else {
return false;
}
}
emit statusBarTextChanged(tr("Password changing: %1").arg(userName),
true, true);
TaskChangePassword *task;
task = new (std::nothrow) TaskChangePassword(
m_isdsSession.isdsCtxMap[userName], &m_netLayer, OTP_TYPE_HOTP,
oldPwd, newPwd);
task->setAutoDelete(false);
m_workPool.runSingle(task);
success = TaskChangePassword::DL_SUCCESS == task->m_result;
delete task;
} else {
TaskChangePassword *task;
task = new (std::nothrow) TaskChangePassword(
m_isdsSession.isdsCtxMap[userName], &m_netLayer, OTP_NO_OTP,
oldPwd, newPwd);
task->setAutoDelete(false);
m_workPool.runSingle(task);
success = TaskChangePassword::DL_SUCCESS == task->m_result;
delete task;
}
if (!m_xmlLayer.isdsChangePassword(m_isdsSession.isdsCtxMap[userName],
newPwd)) {
if (!success) {
Dialogues::errorMessage(Dialogues::CRITICAL,
tr("Change password: %1").arg(userName),
tr("Failed to change password for username '%1'.").arg(userName),
......@@ -427,7 +466,15 @@ bool IsdsWrapper::isdsLogoutOTP(const QString &userName)
return false;
}
if (m_xmlLayer.isdsLogoutOtp(m_isdsSession.isdsCtxMap[userName])) {
QByteArray xmlDataOut;
QString url = m_isdsSession.isdsCtxMap[userName].url.toString();
url.remove("apps/");
url.append(OTP_LOGOUT_LOCATOR);
url.replace("XXXXX", m_isdsSession.isdsCtxMap[userName].url.host());
m_isdsSession.isdsCtxMap[userName].url.setUrl(url);
if (m_netLayer.sendSoapRequest(m_isdsSession.isdsCtxMap[userName],
LOGIN_SERVICE, NULL, xmlDataOut)) {
return m_isdsSession.removeIsdsCtx(userName);
}
......@@ -663,7 +710,22 @@ bool IsdsWrapper::loginToIsds(IsdsSession::IsdsContext &ctx)
}
/* Start login proccess */
success = m_xmlLayer.isdsConnectToDatabox(ctx);
QByteArray xmlDataOut;
/* Send SOAP request */
if (ctx.login_method == USERNAME_PWD_TOTP) {
if (ctx.pass_phrase.isEmpty()) {
success = m_netLayer.createLoginRequest(ctx, LOGIN_SERVICE,
XmlLayer::xmlCreateLoginPingSoapRequest(), xmlDataOut);
} else {
success = m_netLayer.secondTotpLoginRequest(ctx,
XmlLayer::xmlCreateLoginPingSoapRequest(), xmlDataOut);
}
} else {
success = m_netLayer.createLoginRequest(ctx, LOGIN_SERVICE,
XmlLayer::xmlCreateLoginPingSoapRequest(), xmlDataOut);
}
success = XmlLayer::parseLoginResponse(xmlDataOut, ctx.last_isds_msg);
/* Login was not succesfull */
if (!success) {
......@@ -706,7 +768,23 @@ bool IsdsWrapper::loginToIsds(IsdsSession::IsdsContext &ctx)
} while (ok && pwd.isEmpty());
ctx.pass_phrase = pwd;
success = m_xmlLayer.isdsConnectToDatabox(ctx);
/* Start login proccess */
QByteArray xmlDataOut;
/* Send SOAP request */
if (ctx.login_method == USERNAME_PWD_TOTP) {
if (ctx.pass_phrase.isEmpty()) {
success = m_netLayer.createLoginRequest(ctx, LOGIN_SERVICE,
XmlLayer::xmlCreateLoginPingSoapRequest(), xmlDataOut);
} else {
success = m_netLayer.secondTotpLoginRequest(ctx,
XmlLayer::xmlCreateLoginPingSoapRequest(), xmlDataOut);
}
} else {
success = m_netLayer.createLoginRequest(ctx, LOGIN_SERVICE,
XmlLayer::xmlCreateLoginPingSoapRequest(), xmlDataOut);
}
success = XmlLayer::parseLoginResponse(xmlDataOut, ctx.last_isds_msg);
} while (!success);
ctx.pass_phrase = "";
......
......@@ -26,9 +26,11 @@
#include <QObject>
#include "src/messages.h"
#include "src/net/db_wrapper.h"
#include "src/net/net_layer.h"
#include "src/net/isds_const.h"
#include "src/net/isds_session.h"
#include "src/net/xml_layer.h"
#include "src/worker/pool.h"
class MessageListModel; /* Forward declaration. */
......@@ -290,12 +292,6 @@ private:
* @brief Worker pool instance.
*/
WorkerPool m_workPool;
/*!
* TODO - will be removed in the future.
*/
XmlLayer m_xmlLayer;
};
#endif // _ISDS_WRAPPER_H_
......@@ -22,6 +22,8 @@
*/
#include <QDebug>
#include <QDate>
#include <QDateTime>
#include <QFileInfo>
#include "src/net/isds_const.h"
......@@ -239,119 +241,6 @@ QByteArray XmlLayer::xmlCreateSoapEnvelope(const QString &xmlContent)
return requestContent.toUtf8();
}
// TODO - remove
bool XmlLayer::isdsConnectToDatabox(IsdsSession::IsdsContext &ctx)
{
qDebug("%s()", __func__);
QByteArray xmlDataOut;
QString xmlContent("<DummyOperation xmlns=\"");
xmlContent.append(ISDS_NS);
xmlContent.append("\"/>");
if (ctx.login_method == USERNAME_PWD_TOTP) {
if (ctx.pass_phrase.isEmpty()) {
return m_netLayer.createLoginRequest(ctx, LOGIN_SERVICE,
xmlCreateSoapEnvelope(xmlContent), xmlDataOut);
} else {
if (!m_netLayer.secondTotpLoginRequest(ctx,
xmlCreateSoapEnvelope(xmlContent), xmlDataOut)) {
return false;
}
}
} else {
if (!m_netLayer.createLoginRequest(ctx, LOGIN_SERVICE,
xmlCreateSoapEnvelope(xmlContent), xmlDataOut)) {
return false;
}
}
return parseLoginResponse(xmlDataOut, ctx.last_isds_msg);
}
// TODO - remove
bool XmlLayer::isdsChangePassword(IsdsSession::IsdsContext &ctx,
const QString &newPwd)
{
qDebug("%s()", __func__);
QString soapAction;
QByteArray xmlDataOut;
QString xmlContent;
if (ctx.login_method == USERNAME_PWD_HOTP ||
ctx.login_method == USERNAME_PWD_TOTP) {
QString dbOTPType = "TOTP";
if (ctx.login_method == USERNAME_PWD_HOTP) {
dbOTPType = "HOTP";
}
soapAction.append(OTP_CHNG_PWD_SERVICE);
xmlContent.append("<ChangePasswordOTP xmlns=\"");
xmlContent.append(OISDS_NS);
xmlContent.append("\"><dbOldPassword>");
xmlContent.append(ctx.password);
xmlContent.append("</dbOldPassword><dbNewPassword>");
xmlContent.append(newPwd);
xmlContent.append("</dbNewPassword><dbOTPType>");
xmlContent.append(dbOTPType);
xmlContent.append("</dbOTPType></ChangePasswordOTP>");
} else {
soapAction.append(DB_SERVICE);
xmlContent.append("<ChangeISDSPassword xmlns=\"");
xmlContent.append(ISDS_NS);
xmlContent.append("\"><dbOldPassword>");
xmlContent.append(ctx.password);
xmlContent.append("</dbOldPassword><dbNewPassword>");
xmlContent.append(newPwd);
xmlContent.append("</dbNewPassword></ChangeISDSPassword>");
}
if (!m_netLayer.createChangePwdRequest(ctx, soapAction,
xmlCreateSoapEnvelope(xmlContent), xmlDataOut)) {
return false;
}
if (!parseDbStatusFromXml(xmlDataOut, ctx.last_isds_msg)) {
return false;
}
return true;
}
// TODO - remove
bool XmlLayer::isdsSendSMS(IsdsSession::IsdsContext &ctx)
{
qDebug("%s()", __func__);
QByteArray xmlDataOut;
QString xmlContent("<SendSMSCode xmlns=\"");
xmlContent.append(OISDS_NS);
xmlContent.append("\"></SendSMSCode>");
if (!m_netLayer.createChangePwdRequest(ctx, OTP_CHNG_PWD_SERVICE,
xmlCreateSoapEnvelope(xmlContent), xmlDataOut)) {
return false;
}
return parseDbStatusFromXml(xmlDataOut, ctx.last_isds_msg);
}
bool XmlLayer::isdsLogoutOtp(IsdsSession::IsdsContext &ctx)
{
qDebug("%s()", __func__);
QString url = ctx.url.toString();
url.remove("apps/");
url.append(OTP_LOGOUT_LOCATOR);
url.replace("XXXXX", ctx.url.host());
ctx.url.setUrl(url);
QString soapAction(LOGIN_SERVICE);
QByteArray xmlDataOut;
return m_netLayer.sendSoapRequest(ctx, soapAction, NULL, xmlDataOut);
}
bool XmlLayer::completeMessageParse(QXmlStreamReader &xml,
Messages::Message &msg, QList<Files::File> &fileList)
{
......
......@@ -29,7 +29,6 @@
#include <QXmlStreamReader>
#include "src/net/db_wrapper.h"
#include "src/net/net_layer.h"
/*
* Class XmlLayer realizes XML layer of SOAP.
......@@ -186,42 +185,6 @@ public:
static
QByteArray xmlCreateSoapEnvelope(const QString &xmlContent);
/*!
* @brief Connect to databox on ISDS server.
*
* @param[in,out] ctx Account isds context structure.
* @return true if success.
*/
// TODO - remove
bool isdsConnectToDatabox(IsdsSession::IsdsContext &ctx);
/*!
* @brief Change password in ISDS.
*
* @param[in,out] ctx Account isds context structure.
* @param[in] newPwd new password.
*/
// TODO - remove
bool isdsChangePassword(IsdsSession::IsdsContext &ctx,
const QString &newPwd);
/*!
* @brief Send SMS for OTP login method.
*
* @param[in,out] ctx Account isds context structure.
* @return true if success.
*/
// TODO - remove
bool isdsSendSMS(IsdsSession::IsdsContext &ctx);
/*!
* @brief Logout OTP account from ISDS.
*
* @param[in,out] ctx Account isds context structure.
* @return true if success.
*/
bool isdsLogoutOtp(IsdsSession::IsdsContext &ctx);
/*!
* @brief Parse completeMessageParse XML.
*
......@@ -430,14 +393,6 @@ public:
static
Files::File parseFile(QXmlStreamReader &xml, const qint64 msgId,
const QString &downloadDate);
/*!
* @brief Instance of NetLayer class (net_layer.h).
*
* Object NetLayer realizes POST/GET requests and net management.
*/
// TODO - remove
NetLayer m_netLayer;
};
#endif /* _XML_LAYER_H_ */
/*
* Copyright (C) 2014-2017 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
* OpenSSL library under certain conditions as described in each
* individual source file, and distribute linked combinations including
* the two.
*/
#include "src/log/log.h"
#include "src/net/isds_const.h"
#include "src/net/xml_layer.h"
#include "src/worker/pool.h" /* List with whole messages. */
#include "src/worker/task_change_password.h"
TaskChangePassword::TaskChangePassword(IsdsSession::IsdsContext &ctx,
NetLayer *netLayer, const QString &dbOTPType, const QString &oldPwd,
const QString &newPwd)
: m_result(DL_ERR),
m_ctx(ctx),
m_netLayer(netLayer),
m_dbOTPType(dbOTPType),
m_oldPwd(oldPwd),
m_newPwd(newPwd)
{
}
void TaskChangePassword::run(void)
{
if (Q_NULLPTR == m_netLayer) {
Q_ASSERT(0);
return;
}
logDebugLv0NL("Starting change password task in thread '%p'",
(void *) QThread::currentThreadId());
/* ### Worker task begin. ### */
logDebugLv1NL("%s", "-----------------------------------------------");
logDebugLv1NL("Change password for account '%s'.",
m_ctx.account_name.toUtf8().constData());
logDebugLv1NL("%s", "-----------------------------------------------");
m_result = changePassword(m_ctx, m_netLayer, m_dbOTPType, m_oldPwd, m_newPwd);
/* ### Worker task end. ### */
logDebugLv0NL("Change password task finished in thread '%p'",
(void *) QThread::currentThreadId());
}
enum TaskChangePassword::Result TaskChangePassword::changePassword(
IsdsSession::IsdsContext &ctx, NetLayer *netLayer, const QString &dbOTPType,
const QString &oldPwd, const QString &newPwd)
{
if (ctx.username.isEmpty()) {
Q_ASSERT(0);
return DL_ERR;
}
QByteArray xmlDataOut;
/* Send SOAP request */
if (dbOTPType == OTP_NO_OTP) {
if (!netLayer->createChangePwdRequest(ctx, DB_SERVICE,
XmlLayer::xmlCreateChangeISDSPasswordSoapRequest(oldPwd, newPwd),
xmlDataOut)) {
return DL_ISDS_ERROR;
}
} else {
if (!netLayer->createChangePwdRequest(ctx, OTP_CHNG_PWD_SERVICE,
XmlLayer::xmlCreateChangePasswordOTPSoapRequest(dbOTPType, oldPwd, newPwd),
xmlDataOut)) {
return DL_ISDS_ERROR;
}
}
/* Parse SOAP response */
if (!XmlLayer::parseDbStatusFromXml(xmlDataOut, ctx.last_isds_msg)) {
return DL_XML_ERROR;
}
return DL_SUCCESS;
}
/*
* Copyright (C) 2014-2017 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
* OpenSSL library under certain conditions as described in each
* individual source file, and distribute linked combinations including
* the two.
*/
#ifndef _TASK_CHANGE_PASSWORD_H_
#define _TASK_CHANGE_PASSWORD_H_
#include "src/net/isds_session.h"
#include "src/net/net_layer.h"
#include "src/worker/task.h"
/*!
* @brief Task describing change password.
*/
class TaskChangePassword : public Task {
public:
/*!
* @brief Return state describing what happened.
*/
enum Result {
DL_SUCCESS, /*!< Operation was successful. */
DL_ISDS_ERROR, /*!< Error communicating with ISDS. */
DL_XML_ERROR, /*!< Error xml parse. */
DL_DB_INS_ERR, /*!< Error inserting into database. */
DL_ERR /*!< Other error. */
};
/*!
* @brief Constructor.
*
* @param[in] ctx Account isds context (include username).
* @param[in] netLayer Pointer to network manager.
* @param[in] dbOTPType OTP login type (TOTP/HOTP).
* @param[in] oldPwd Old password.
* @param[in] newPwd New password.
*/
explicit TaskChangePassword(IsdsSession::IsdsContext &ctx,
NetLayer *netLayer, const QString &dbOTPType, const QString &oldPwd,
const QString &newPwd);
/*!
* @brief Performs actual change password.
*/
virtual
void run(void) Q_DECL_OVERRIDE;
/*!
* @brief Change password.
*
* @param[in] ctx Account isds context (include username).
* @param[in] netLayer Pointer to network manager.
* @param[in] dbOTPType OTP login type (TOTP/HOTP).
* @param[in] oldPwd Old password.
* @param[in] newPwd New password.
* @return Error state.
*/
static
enum Result changePassword(IsdsSession::IsdsContext &ctx,
NetLayer *netLayer, const QString &dbOTPType, const QString &oldPwd,
const QString &newPwd);
enum Result m_result; /*!< Return state. */
private:
/*!
* Disable copy and assignment.
*/
TaskChangePassword(const TaskChangePassword &);
TaskChangePassword &operator=(const TaskChangePassword &);
IsdsSession::IsdsContext m_ctx; /*!< Account isds context. */
NetLayer *m_netLayer; /*!< Pointer to network manager to send request. */
QString m_dbOTPType; /*!< OTP login type (TOTP/HOTP). */
QString m_oldPwd; /*!< Old password. */
QString m_newPwd; /*!< New password. */
};
#endif /* _TASK_CHANGE_PASSWORD_H_ */
/*
* Copyright (C) 2014-2017 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
* OpenSSL library under certain conditions as described in each
* individual source file, and distribute linked combinations including
* the two.
*/
#include "src/log/log.h"
#include "src/net/isds_const.h"
#include "src/net/xml_layer.h"
#include "src/worker/pool.h" /* List with whole messages. */
#include "src/worker/task_send_sms.h"
TaskSendSMS::TaskSendSMS(IsdsSession::IsdsContext &ctx, NetLayer *netLayer)
: m_result(DL_ERR),
m_ctx(ctx),
m_netLayer(netLayer)
{
}
void TaskSendSMS::run(void)
{
if (Q_NULLPTR == m_netLayer) {
Q_ASSERT(0);
return;
}
logDebugLv0NL("Starting send SMS task in thread '%p'",
(void *) QThread::currentThreadId());
/* ### Worker task begin. ### */
logDebugLv1NL("%s", "-----------------------------------------------");
logDebugLv1NL("Send SM task finished in thread for account '%s'.",
m_ctx.account_name.toUtf8().constData());
logDebugLv1NL("%s", "-----------------------------------------------");
m_result = sendSMS(m_ctx, m_netLayer);
/* ### Worker task end. ### */
logDebugLv0NL("Send SM task finished in thread '%p'",
(void *) QThread::currentThreadId());
}
enum TaskSendSMS::Result TaskSendSMS::sendSMS(
IsdsSession::IsdsContext &ctx, NetLayer *netLayer)
{
if (ctx.username.isEmpty()) {
Q_ASSERT(0);
return DL_ERR;
}
QByteArray xmlDataOut;
/* Send SOAP request */
if (!netLayer->sendSoapRequest(ctx, OTP_CHNG_PWD_SERVICE,
XmlLayer::xmlCreateSendSMSSoapRequest(), xmlDataOut)) {
return DL_ISDS_ERROR;
}
/* Parse SOAP response */
if (!XmlLayer::parseDbStatusFromXml(xmlDataOut, ctx.last_isds_msg)) {
return DL_XML_ERROR;
}
return DL_SUCCESS;
}
/*
* Copyright (C) 2014-2017 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
* OpenSSL library under certain conditions as described in each
* individual source file, and distribute linked combinations including
* the two.
*/
#ifndef _TASK_SEND_SMS_H_
#define _TASK_SEND_SMS_H_
#include "src/net/isds_session.h"
#include "src/net/net_layer.h"
#include "src/worker/task.h"
/*!
* @brief Task describing send SMS.
*/
class TaskSendSMS : public Task {
public:
/*!
* @brief Return state describing what happened.
*/
enum Result {
DL_SUCCESS, /*!< Operation was successful. */
DL_ISDS_ERROR, /*!< Error communicating with ISDS. */
DL_XML_ERROR, /*!< Error xml parse. */
DL_ERR /*!< Other error. */
};
/*!
* @brief Constructor.