~phablet-team/telephony-service/trunk

« back to all changes in this revision

Viewing changes to libtelephonyservice/multimediaaccountentry.cpp

  • Committer: Tiago Salem Herrmann
  • Date: 2016-12-06 16:45:01 UTC
  • mfrom: (1212.1.6 fix-hardcoded-paths)
  • mto: This revision was merged to the branch mainline in revision 1222.
  • Revision ID: tiago.herrmann@canonical.com-20161206164501-rw041bjz35wq9t17
merge parent branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2013-2015 Canonical, Ltd.
3
 
 *
4
 
 * Authors:
5
 
 *  Gustavo Pichorim Boiko <gustavo.boiko@canonical.com>
6
 
 *  Tiago Salem Herrmann <tiago.herrmann@canonical.com>
7
 
 *
8
 
 * This file is part of telephony-service.
9
 
 *
10
 
 * telephony-service is free software; you can redistribute it and/or modify
11
 
 * it under the terms of the GNU General Public License as published by
12
 
 * the Free Software Foundation; version 3.
13
 
 *
14
 
 * telephony-service is distributed in the hope that it will be useful,
15
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 
 * GNU General Public License for more details.
18
 
 *
19
 
 * You should have received a copy of the GNU General Public License
20
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
 
 */
22
 
 
23
 
#include "multimediaaccountentry.h"
24
 
#include "phoneutils.h"
25
 
#include "telepathyhelper.h"
26
 
 
27
 
MultimediaAccountEntry::MultimediaAccountEntry(const Tp::AccountPtr &account, QObject *parent) :
28
 
    AccountEntry(account, parent)
29
 
{
30
 
}
31
 
 
32
 
AccountEntry::AccountType MultimediaAccountEntry::type() const
33
 
{
34
 
    return AccountEntry::MultimediaAccount;
35
 
}
36
 
 
37
 
bool MultimediaAccountEntry::connected() const
38
 
{
39
 
    return !mAccount.isNull() && !mAccount->connection().isNull() &&
40
 
           !mAccount->connection()->selfContact().isNull() &&
41
 
            mAccount->connection()->selfContact()->presence().type() != Tp::ConnectionPresenceTypeOffline;
42
 
}
43
 
 
44
 
bool MultimediaAccountEntry::compareIds(const QString &first, const QString &second) const
45
 
{
46
 
    return PhoneUtils::comparePhoneNumbers(first, second) > PhoneUtils::NO_MATCH;
47
 
}
48
 
 
49
 
QStringList MultimediaAccountEntry::addressableVCardFields()
50
 
{
51
 
    return mAccount->protocolInfo().addressableVCardFields();
52
 
}
53
 
 
54
 
void MultimediaAccountEntry::onConnectionChanged(Tp::ConnectionPtr connection)
55
 
{
56
 
    // make sure the generic code is also run
57
 
    AccountEntry::onConnectionChanged(connection);
58
 
}