source: SMSSender/gateways/ETHZ/business/account.cpp @ 378:7553d82ad234

separation-frontend-backend
Last change on this file since 378:7553d82ad234 was 378:7553d82ad234, checked in by Sämy Zehnder <saemy.zehnder@…>, 7 years ago
  • Reverts the removal of the CA certificates to avoid the disavailability of a service due to the system CA store not containing it's CA.
File size: 2.3 KB
Line 
1/*
2 ETHZ gateway plugin - The smssender plugin for the ETHZ sms platform.
3 Copyright (C) 2010-2014, gorrión. See http://smssender.gorrion.ch
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 */
18#include "account.h"
19
20#include <algorithm>
21#include <math.h>
22
23#include <QDebug>
24#include <QThread>
25
26#include "common/domain/snumber.h"
27#include "common/exceptions/stdexceptions.h"
28#include "common/exceptions/loginaccountexceptions.h"
29#include "common/validation/defaultaccountvalidator.h"
30#include "gateways/common/business/defaultlogininittask.h"
31#include "gateways/common/persistence/defaultaccountstoragehelper.h"
32#include "gateways/ETHZ/business/account_tasks.h"
33#include "gateways/ETHZ/business/gateway.h"
34
35namespace ETHZ {
36
37Account::Account(IGateway *gateway)
38    : BaseAccount(gateway)
39    , m_httpHelper(new SNetworkHelper)
40{
41    m_httpHelper->addTrustedCA(":/certs/QuoVadisRootCA.crt");
42}
43
44Persistence::IStorageHelper* Account::createStorageHelper(Persistence::IMainStorage *storage) {
45    return new Persistence::DefaultAccountStorageHelper(this, storage, "s_arfoPo20fWcdp;ISh2984710asfd,p.ymd:dwqs");
46}
47IValidator* Account::createValidator() const {
48    return new DefaultAccountValidator(this);
49}
50
51IAccountInitTask* Account::doCreateInitTask() {
52    return new DefaultLoginInitTask(this);
53}
54IAccountLoginTask* Account::doCreateLoginTask() {
55    return new AccountLoginTask(this);
56}
57ISMSSendTask* Account::doCreateSMSSendTask(const QString &message, const QSet<const SContact *> &recipients) {
58    return new SMSSendTask(this, message, recipients);
59}
60
61SNetworkHelper *Account::httpHelper() const {
62    return m_httpHelper.data();
63}
64
65void Account::cancelSMSSending() {
66    // TODO: Implement this
67}
68
69bool Account::checkStillLoggedIn() {
70    return isLoggedIn();
71}
72
73}
Note: See TracBrowser for help on using the repository browser.