[Bug 43828] avoid downloading the roster at every connection

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Dec 20 10:31:05 CET 2011


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

--- Comment #1 from Andre Moreira Magalhaes <andrunko at gmail.com> 2011-12-20 09:31:05 UTC ---
Here goes a first review, but I would prefer if some gabble developer could
check it also.

+ if (!gabble_roster_get_download_at_connection (base))
+ {
+ WockyStanza *stanza;
+ stanza = _gabble_roster_message_new (self, WOCKY_STANZA_SUB_TYPE_GET,
+ NULL);
+
+ conn_util_send_iq_async (self->priv->conn, stanza,
+ self->priv->cancel_on_disconnect,
+ roster_received_cb, tp_weak_ref_new (self, NULL, NULL));
+
+ g_object_unref (stanza);
+ }
+ else
+ {
+ g_set_error_literal (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
+ "roster already requested at connection");
+ }
The spec states that when DownloadAtConnection is true, Download should do
nothing, so no need to raise an error if the roster was already requested.

+ gabble_simple_async_succeed_or_fail_in_idle (self, callback, user_data,
+ gabble_roster_request_subscription_async, error);

I guess this should be:
gabble_simple_async_succeed_or_fail_in_idle (self, callback, user_data,
    gabble_roster_download_async, error);

+ iface->download_async = gabble_roster_download_async;
/* we use the default _finish functions, which assume a GSimpleAsyncResult */
+
+ iface->get_download_at_connection =
+ gabble_roster_get_download_at_connection;

Put both assignments before the comment.

The rest looks good to me.

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