[Bug 34796] Implement ContactInfo

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Mar 21 23:36:50 CET 2011


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

--- Comment #16 from Debarshi Ray <debarshi.ray at gmail.com> 2011-03-21 15:36:49 PDT ---
(In reply to comment #12)
> Review of attachment 44074 [details]:
> 
> ::: 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).

Done.

> @@ +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! ☺)

Done.

> @@ +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.

Done. Also removed the GetContactInfo, RefreshContactInfo stubs.

> @@ +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.)

I am a bit clueless about properties and was just imitating Gabble code. I will
try to look at it more closely.

-- 
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