[Bug 34796] Implement ContactInfo

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Mar 21 16:18:35 CET 2011


https://bugs.freedesktop.org/show_bug.cgi?id=34796

--- Comment #12 from Will Thompson <will.thompson at collabora.co.uk> 2011-03-21 08:18:35 PDT ---
Review of attachment 44074:
 --> (https://bugs.freedesktop.org/review?bug=34796&attachment=44074)

::: src/idle-contact-info.c
@@ +49,3 @@
+ */
+static void _insert_contact_field(GPtrArray *contact_info, const gchar
*field_name, const gchar * const *field_params, const gchar * const
*field_values) {
+    gchar *field_name_down = g_ascii_strdown (field_name, -1);

I'd still just use field_name directly, and make sure nothing passes uppercase
strings to this function (as nothing does, so that's fine).

@@ +136,3 @@
+    ContactInfoRequest *request;
+
+    request = g_new0(ContactInfoRequest, 1);

As a general rule, when allocating fixed-sized structs use g_slice_new0() and
g_slice_free(). (Obviously this code is not performance-critical! ☺)

@@ +181,3 @@
+    TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED(TP_BASE_CONNECTION(iface),
context);
+   
tp_svc_connection_interface_contact_info_return_from_set_contact_info(context);
+}

Just leave SetContactInfo entirely unimplemented. Then telepathy-glib will
return a NotImplemented error on your behalf.

@@ +292,3 @@
+        g_value_set_static_boxed(value, getter_data);
+    else
+        g_value_set_uint(value, GPOINTER_TO_UINT(getter_data));

Does NULL really work as SupportedFields? It's meant to be a GPtrArray of
GValues, and part of me would expect dbus-glib to crash if you use NULL
instead.

(It took me a few moments to figure this out; maybe it would be clearer to
define the values in this function, rather than stashing them in getter_data
and casting it.)

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the telepathy-bugs mailing list