[Bug 30094] Have a convenience wrapper for wocky_porter_send_iq_async

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Sep 16 11:22:11 CEST 2010


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

--- Comment #4 from Will Thompson <will.thompson at collabora.co.uk> 2010-09-16 02:22:08 PDT ---
(In reply to comment #3)
> The downside to that kind of finish function would be that you don't get the
> mutually exclusive NULL pattern with error and res_pointer (you could get an
> xmpp stanza, and also errors).

Right, that was the idea with my original _finish_harder(): you don't have to
care about the stanza at all if it has type='error'.

Simon, if you're super-super keen to only have one finish function, I would be
in favour of making this function not return a stanza if an error was extracted
from it. The advantage of having another function was that you could still use
the _send() helper, even if you did want to do more interesting error handling.

How about for now we claim YAGNI, and make the single _finish() function return
a non-NULL WockyStanza if and only if the reply wasn't type='error', and have a
single GError ** parameter? Eitan, I think this would work for your code using
this function. We can revisit this later if we need to.

> Not sure what you mean by a lazy conversion, should I be checking for (GError
> **tp_error) != NULL before conversion? gabble_set_tp_error_from_wocky knows how
> to deal with that (although it probably could return sooner, and not pass to
> gabble_set_tp_conn_error_from_wocky if error == NULL).
> 
> Anyway, I added this in d1094e8. I hope the lazy "||" is not too hackish for
> you!

I think this is lazy enough. If we wanted to make it lazier, the place to do
that would be wocky_xmpp_error_extract(), which could short-circuit right after
the 'if (type != NULL) {..}' block if none of its 'core', 'specialized',
'specialized_node' parameters are non-NULL.

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



More information about the telepathy-bugs mailing list