summaryrefslogtreecommitdiff
path: root/examples/client
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2011-08-05 11:04:58 +0200
committerXavier Claessens <xclaesse@gmail.com>2011-08-05 11:19:06 +0200
commit06acc6e3ff8a391bb99607716271b499f41b27f5 (patch)
tree8d3ff022ca0b95d716ae5ec698e140917afd649e /examples/client
parent319f8960b8969df0251671a7433dbc0689ebd0fd (diff)
contact-list examples: verify state is SUCCESS before getting the contact list
Diffstat (limited to 'examples/client')
-rwxr-xr-xexamples/client/contact-list.c4
-rwxr-xr-xexamples/client/python/contact-list.py3
2 files changed, 5 insertions, 2 deletions
diff --git a/examples/client/contact-list.c b/examples/client/contact-list.c
index 5cda23c61..60a5d9469 100755
--- a/examples/client/contact-list.c
+++ b/examples/client/contact-list.c
@@ -35,7 +35,9 @@ account_manager_prepared_cb (GObject *object,
GPtrArray *contacts;
guint i;
- if (connection == NULL)
+ if (connection == NULL ||
+ tp_connection_get_contact_list_state (connection) !=
+ TP_CONTACT_LIST_STATE_SUCCESS)
continue;
contacts = tp_connection_dup_contact_list (connection);
diff --git a/examples/client/python/contact-list.py b/examples/client/python/contact-list.py
index 8549a4ed7..6a0b331b1 100755
--- a/examples/client/python/contact-list.py
+++ b/examples/client/python/contact-list.py
@@ -11,7 +11,8 @@ def manager_prepared_cb(manager, result, loop):
for account in manager.get_valid_accounts():
connection = account.get_connection()
- if connection is not None:
+ if connection is not None and \
+ connection.get_contact_list_state() == TelepathyGLib.ContactListState.SUCCESS:
contacts = connection.dup_contact_list()
for contact in contacts:
print "%s (%s)" % (contact.get_identifier(), contact.get_contact_groups())