[Bug 34796] Implement ContactInfo

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon May 9 17:36:39 CEST 2011


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

--- Comment #53 from Will Thompson <will.thompson at collabora.co.uk> 2011-05-09 08:36:34 PDT ---
Review of attachment 46403:
 --> (https://bugs.freedesktop.org/review?bug=34796&attachment=46403)

Kind of a kludge but seem like the protocol doesn't actually give us much
choice. :)

::: src/idle-contact-info.c
@@ +323,3 @@
+
+    if (request->contact_info == NULL)
+

I'm sure I've seen this code somewhere before. :)

How about combining this with _is_valid_response? Something like this:

static ContactInfoRequest *
_is_valid_response (IdleConnection *conn, GValueArray *args)
{
  // current body of _is_valid_response, returning NULL rather than FALSE;

  if (request->contact_info == NULL)
    request->contact_info =
dbus_g_type_specialized_construct(TP_ARRAY_TYPE_CONTACT_INFO_FIELD_LIST);

  return request;
}

and then the boilerplate at the top of each function would just be:

{
  // ...
  ContactInfoRequest *request = _is_valid_response (conn, args);

  if (request == NULL)
    return IDLE_PARSER_HANDLER_RESULT_NOT_HANDLED;

  // ...

(This is a general comment on the contact-info code, rather than specifically
about this patch.)

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