2
* Copyright (C) 2013-2015 Canonical, Ltd.
5
* Gustavo Pichorim Boiko <gustavo.boiko@canonical.com>
6
* Tiago Salem Herrmann <tiago.herrmann@canonical.com>
8
* This file is part of telephony-service.
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.
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.
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/>.
23
#include "multimediaaccountentry.h"
24
#include "phoneutils.h"
25
#include "telepathyhelper.h"
27
MultimediaAccountEntry::MultimediaAccountEntry(const Tp::AccountPtr &account, QObject *parent) :
28
AccountEntry(account, parent)
32
AccountEntry::AccountType MultimediaAccountEntry::type() const
34
return AccountEntry::MultimediaAccount;
37
bool MultimediaAccountEntry::connected() const
39
return !mAccount.isNull() && !mAccount->connection().isNull() &&
40
!mAccount->connection()->selfContact().isNull() &&
41
mAccount->connection()->selfContact()->presence().type() != Tp::ConnectionPresenceTypeOffline;
44
bool MultimediaAccountEntry::compareIds(const QString &first, const QString &second) const
46
return PhoneUtils::comparePhoneNumbers(first, second) > PhoneUtils::NO_MATCH;
49
QStringList MultimediaAccountEntry::addressableVCardFields()
51
return mAccount->protocolInfo().addressableVCardFields();
54
void MultimediaAccountEntry::onConnectionChanged(Tp::ConnectionPtr connection)
56
// make sure the generic code is also run
57
AccountEntry::onConnectionChanged(connection);