summaryrefslogtreecommitdiff
path: root/tubes
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@gmail.com>2012-07-17 00:32:37 +0200
committerMatúš Kukan <matus.kukan@gmail.com>2012-07-17 16:40:31 +0200
commit1abd8c22a56bd51a2da2be4da1ef79be04e5b985 (patch)
tree11ec68581ad50bb1dc3ef65de07111b9b0ea55ac /tubes
parenta64fa6c7235559667afef1bb185203fd0d262e44 (diff)
tubes: improve contacts dialog
- do not show until it's ready - do not close it with buttons - buttons for both 1-1 and MUC sessions - display all online contacts Change-Id: Idfbea7ffdf76ef3f31dbeeefe62d69cb5e3e64b7
Diffstat (limited to 'tubes')
-rw-r--r--tubes/source/contact-list.cxx30
1 files changed, 20 insertions, 10 deletions
diff --git a/tubes/source/contact-list.cxx b/tubes/source/contact-list.cxx
index c74a95009c71..0d4680358fd3 100644
--- a/tubes/source/contact-list.cxx
+++ b/tubes/source/contact-list.cxx
@@ -61,6 +61,7 @@ ContactList::ContactList(TpAccountManager *pAccountManager)
TP_CONTACT_FEATURE_ALIAS,
TP_CONTACT_FEATURE_AVATAR_DATA,
TP_CONTACT_FEATURE_CAPABILITIES,
+ TP_CONTACT_FEATURE_PRESENCE,
TP_CONTACT_FEATURE_INVALID);
}
@@ -70,16 +71,25 @@ ContactList::~ContactList()
mpAccountManager = NULL;
}
-static gboolean
-contact_supports_libo_dtube (TpContact *contact)
+static bool
+tb_contact_is_online (TpContact *contact)
{
- TpCapabilities *caps = tp_contact_get_capabilities (contact);
-
- if (caps == NULL)
- return FALSE;
-
- return tp_capabilities_supports_dbus_tubes (caps,
- TP_HANDLE_TYPE_CONTACT, TeleManager::getFullServiceName().getStr());
+ switch (tp_contact_get_presence_type (contact))
+ {
+ case TP_CONNECTION_PRESENCE_TYPE_UNSET:
+ case TP_CONNECTION_PRESENCE_TYPE_OFFLINE:
+ return false;
+ case TP_CONNECTION_PRESENCE_TYPE_AVAILABLE:
+ case TP_CONNECTION_PRESENCE_TYPE_AWAY:
+ case TP_CONNECTION_PRESENCE_TYPE_EXTENDED_AWAY:
+ case TP_CONNECTION_PRESENCE_TYPE_HIDDEN:
+ case TP_CONNECTION_PRESENCE_TYPE_BUSY:
+ return true;
+ case TP_CONNECTION_PRESENCE_TYPE_UNKNOWN:
+ case TP_CONNECTION_PRESENCE_TYPE_ERROR:
+ default:
+ return false;
+ }
}
AccountContactPairV ContactList::getContacts()
@@ -113,7 +123,7 @@ AccountContactPairV ContactList::getContacts()
reinterpret_cast<TpContact *>(g_ptr_array_index (contacts, i));
if (contact != self &&
- contact_supports_libo_dtube (contact))
+ tb_contact_is_online (contact))
{
g_object_ref (account);
g_object_ref (contact);