summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2013-10-28 16:56:38 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2013-11-11 16:49:34 +0000
commit1aa78d2cf4d9b44c15c5b627eef210943646e3fb (patch)
treed3ec60794c4fbd10f43e6b4d5d9e35da53e76682
parentd01acacceaef93160af478f8534e00d264baba03 (diff)
downloadtelepathy-glib-1aa78d2cf4d9b44c15c5b627eef210943646e3fb.tar.gz
TpProtocol: improve debug
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71048 Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
-rw-r--r--telepathy-glib/protocol.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/telepathy-glib/protocol.c b/telepathy-glib/protocol.c
index 8ab0bc81a..867db25f1 100644
--- a/telepathy-glib/protocol.c
+++ b/telepathy-glib/protocol.c
@@ -585,6 +585,9 @@ tp_protocol_constructed (GObject *object)
if (tp_proxy_has_interface_by_id (self,
TP_IFACE_QUARK_PROTOCOL_INTERFACE_AVATARS))
{
+ DEBUG ("%s/%s implements Avatars", self->priv->cm_name,
+ self->priv->protocol_struct.name);
+
self->priv->avatar_req = tp_avatar_requirements_new (
(GStrv) tp_asv_get_strv (self->priv->protocol_properties,
TP_PROP_PROTOCOL_INTERFACE_AVATARS_SUPPORTED_AVATAR_MIME_TYPES),
@@ -607,6 +610,9 @@ tp_protocol_constructed (GObject *object)
if (tp_proxy_has_interface_by_id (self,
TP_IFACE_QUARK_PROTOCOL_INTERFACE_ADDRESSING))
{
+ DEBUG ("%s/%s implements Addressing", self->priv->cm_name,
+ self->priv->protocol_struct.name);
+
self->priv->addressable_vcard_fields = asv_strdupv_or_empty (
self->priv->protocol_properties,
TP_PROP_PROTOCOL_INTERFACE_ADDRESSING_ADDRESSABLE_VCARD_FIELDS);
@@ -618,13 +624,39 @@ tp_protocol_constructed (GObject *object)
if (tp_proxy_has_interface_by_id (self,
TP_IFACE_QUARK_PROTOCOL_INTERFACE_PRESENCE))
{
+ DEBUG ("%s/%s implements Presence", self->priv->cm_name,
+ self->priv->protocol_struct.name);
+
self->priv->presence_statuses = tp_asv_get_boxed (
self->priv->protocol_properties,
TP_PROP_PROTOCOL_INTERFACE_PRESENCE_STATUSES,
TP_HASH_TYPE_SIMPLE_STATUS_SPEC_MAP);
if (self->priv->presence_statuses != NULL)
- g_hash_table_ref (self->priv->presence_statuses);
+ {
+ GHashTableIter iter;
+ gpointer k, v;
+
+ g_hash_table_ref (self->priv->presence_statuses);
+
+ DEBUG ("%s/%s presence statuses:", self->priv->cm_name,
+ self->priv->protocol_struct.name);
+ g_hash_table_iter_init (&iter, self->priv->presence_statuses);
+
+ while (g_hash_table_iter_next (&iter, &k, &v))
+ {
+ guint type;
+ gboolean on_self, message;
+
+ tp_value_array_unpack (v, 3,
+ &type,
+ &on_self,
+ &message);
+ DEBUG ("\tstatus '%s': type %u%s%s",
+ (const gchar *) k, type, on_self ? ", can set on self" : "",
+ message ? ", has message" : "");
+ }
+ }
}
/* become ready immediately */