source: SMSSender/gateways/ETHZ/business/account.cpp @ 375:c57f1c92bcb8

separation-frontend-backend
Last change on this file since 375:c57f1c92bcb8 was 375:c57f1c92bcb8, checked in by Sämy Zehnder <saemy.zehnder@…>, 7 years ago
  • Removes explicit listing of CAs wherever possible (uses the systems trusted CAs).
  • Cleans up the locales in the resource files.
File size: 2.2 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}
42
43Persistence::IStorageHelper* Account::createStorageHelper(Persistence::IMainStorage *storage) {
44    return new Persistence::DefaultAccountStorageHelper(this, storage, "s_arfoPo20fWcdp;ISh2984710asfd,p.ymd:dwqs");
45}
46IValidator* Account::createValidator() const {
47    return new DefaultAccountValidator(this);
48}
49
50IAccountInitTask* Account::doCreateInitTask() {
51    return new DefaultLoginInitTask(this);
52}
53IAccountLoginTask* Account::doCreateLoginTask() {
54    return new AccountLoginTask(this);
55}
56ISMSSendTask* Account::doCreateSMSSendTask(const QString &message, const QSet<const SContact *> &recipients) {
57    return new SMSSendTask(this, message, recipients);
58}
59
60SNetworkHelper *Account::httpHelper() const {
61    return m_httpHelper.data();
62}
63
64void Account::cancelSMSSending() {
65    // TODO: Implement this
66}
67
68bool Account::checkStillLoggedIn() {
69    return isLoggedIn();
70}
71
72}
Note: See TracBrowser for help on using the repository browser.