[empathy: 3/5] Blocking: don't critical if ContactBlockingCapabilities is missing



commit 0f7e44ae1ea5a497083dc0982626b7f2cea7d36a
Author: Will Thompson <will thompson collabora co uk>
Date:   Mon Aug 8 23:43:42 2011 +0200

    Blocking: don't critical if ContactBlockingCapabilities is missing
    
    Haze has a deny list, and ostensibly implements ContactBlocking, but
    doesn't really implement that property.  Naughty Haze hackers. They
    should be blocked.

 libempathy/empathy-tp-contact-list.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/libempathy/empathy-tp-contact-list.c b/libempathy/empathy-tp-contact-list.c
index d947e72..11990a9 100644
--- a/libempathy/empathy-tp-contact-list.c
+++ b/libempathy/empathy-tp-contact-list.c
@@ -821,7 +821,19 @@ list_get_contact_blocking_capabilities_cb (TpProxy *conn,
 	EmpathyTpContactListPriv *priv = GET_PRIV (list);
 	TpContactBlockingCapabilities caps;
 
-	g_return_if_fail (G_VALUE_HOLDS_UINT (value));
+	if (in_error != NULL) {
+		DEBUG ("Get(Blocking, ContactBlockingCapabilities) on %s failed: %s",
+		       tp_proxy_get_object_path (conn),
+		       in_error->message);
+		return;
+	}
+
+	if (!G_VALUE_HOLDS_UINT (value)) {
+		DEBUG ("Get(Blocking, ContactBlockingCapabilities) on %s returned a %s, not a uint",
+		       tp_proxy_get_object_path (conn),
+		       G_VALUE_TYPE_NAME (value));
+		return;
+	}
 
 	caps = g_value_get_uint (value);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]