diff options
author | dequis <dx@dxzone.com.ar> | 2017-07-12 15:37:09 -0300 |
---|---|---|
committer | dequis <dx@dxzone.com.ar> | 2017-07-12 15:46:15 -0300 |
commit | cdc41b66d21e4758d22d9cbc0e8ce84bc79ce95f (patch) | |
tree | 3da17d4b0940c053afff53505ab69d3daffae035 | |
parent | 8bbf163cfb796524754d7872e148c9793cd4452f (diff) | |
download | bitlbee-facebook-cdc41b66d21e4758d22d9cbc0e8ce84bc79ce95f.tar.gz bitlbee-facebook-cdc41b66d21e4758d22d9cbc0e8ce84bc79ce95f.tar.bz2 bitlbee-facebook-cdc41b66d21e4758d22d9cbc0e8ce84bc79ce95f.tar.xz |
Fix login hang/timeout when the last page of contacts is empty
The contact list is fetched in pages of 500, but non-friends need to
be filtered out, so you could end up in a situation where the last
page of results is all non-friends. The "contacts" signal was emitted
for each page of results, and has a flag that says if it's complete,
which lets login continue.
So when the last page of the contact list is empty (all non-friends)
the contacts signal isn't emitted, and login gets stuck forever.
This commit changes it so that the signal is emitted with an empty
'users' GSList when it's complete (and when it's an initial fetch,
not when when parsing deltas, which doesn't use the 'users' GSList)
Thanks to dcxk for finding this and helping debug it.
-rw-r--r-- | facebook/facebook-api.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/facebook/facebook-api.c b/facebook/facebook-api.c index a72f386..4661ef4 100644 --- a/facebook/facebook-api.c +++ b/facebook/facebook-api.c @@ -2389,7 +2389,7 @@ fb_api_cb_contacts(FbHttpRequest *req, gpointer data) priv->contacts_delta = g_strdup(is_delta ? cursor : delta_cursor); } - if (users) { + if (users || (complete && !is_delta)) { g_signal_emit_by_name(api, "contacts", users, complete); } |