summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlvaro Soliverez <alvaro.soliverez@collabora.co.uk>2011-08-03 06:50:59 -0700
committerAlvaro Soliverez <alvaro.soliverez@collabora.co.uk>2011-08-03 06:50:59 -0700
commitbaa286833c5558a7385bf8fe445fb9211fca50e3 (patch)
treeb4dddad63a5ef862ea7ea50aa5dadc2774e835b6
parent147d6f04eb1fbc845d739ab02c1b9d3c1826646b (diff)
parentfe0e36b227e597a2dd5045bf0458568544bf3211 (diff)
Merge branch 'patches'
-rw-r--r--TelepathyQt4Yell/Models/accounts-model-item.cpp10
-rw-r--r--TelepathyQt4Yell/Models/accounts-model-item.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/TelepathyQt4Yell/Models/accounts-model-item.cpp b/TelepathyQt4Yell/Models/accounts-model-item.cpp
index 02dbcc6..4e423a3 100644
--- a/TelepathyQt4Yell/Models/accounts-model-item.cpp
+++ b/TelepathyQt4Yell/Models/accounts-model-item.cpp
@@ -308,6 +308,16 @@ void AccountsModelItem::setRequestedPresence(int type, const QString &status, co
mPriv->mAccount->setRequestedPresence(presence);
}
+bool AccountsModelItem::isPresenceSupported(int type) const
+{
+ Tp::PresenceSpecList list = mPriv->mAccount->allowedPresenceStatuses();
+ Q_FOREACH (const Tp::PresenceSpec &p, list) {
+ if (p.presence().type() == type && p.maySetOnSelf())
+ return true;
+ }
+ return false;
+}
+
void AccountsModelItem::onRemoved()
{
int index = parent()->indexOf(this);
diff --git a/TelepathyQt4Yell/Models/accounts-model-item.h b/TelepathyQt4Yell/Models/accounts-model-item.h
index f4cb162..29c613f 100644
--- a/TelepathyQt4Yell/Models/accounts-model-item.h
+++ b/TelepathyQt4Yell/Models/accounts-model-item.h
@@ -54,6 +54,7 @@ public:
Q_INVOKABLE void setAutomaticPresence(int type, const QString &status, const QString &statusMessage);
Q_INVOKABLE void setRequestedPresence(int type, const QString &status, const QString &statusMessage);
+ Q_INVOKABLE bool isPresenceSupported(int type) const;
void clearContacts();