diff options
-rw-r--r-- | protocols/twitter/twitter.c | 8 | ||||
-rw-r--r-- | protocols/twitter/twitter_lib.c | 5 | ||||
-rw-r--r-- | protocols/twitter/twitter_lib.h | 2 |
3 files changed, 8 insertions, 7 deletions
diff --git a/protocols/twitter/twitter.c b/protocols/twitter/twitter.c index 4626cf55..57820568 100644 --- a/protocols/twitter/twitter.c +++ b/protocols/twitter/twitter.c @@ -39,13 +39,11 @@ gboolean twitter_main_loop(gpointer data, gint fd, b_input_condition cond) // Check if we are still logged in... if (!g_slist_find(twitter_connections, ic)) - return 0; + return FALSE; // Do stuff.. - twitter_get_timeline(ic, -1); - - // If we are still logged in run this function again after timeout. - return (ic->flags & OPT_LOGGED_IN) == OPT_LOGGED_IN; + return twitter_get_timeline(ic, -1) && + ((ic->flags & OPT_LOGGED_IN) == OPT_LOGGED_IN); } static void twitter_main_loop_start(struct im_connection *ic) diff --git a/protocols/twitter/twitter_lib.c b/protocols/twitter/twitter_lib.c index 05222af2..a98054dd 100644 --- a/protocols/twitter/twitter_lib.c +++ b/protocols/twitter/twitter_lib.c @@ -899,7 +899,7 @@ static void twitter_get_mentions(struct im_connection *ic, gint64 next_cursor); /** * Get the timeline with optionally mentions */ -void twitter_get_timeline(struct im_connection *ic, gint64 next_cursor) +gboolean twitter_get_timeline(struct im_connection *ic, gint64 next_cursor) { struct twitter_data *td = ic->proto_data; gboolean include_mentions = set_getbool(&ic->acc->set, "fetch_mentions"); @@ -908,6 +908,7 @@ void twitter_get_timeline(struct im_connection *ic, gint64 next_cursor) if (++td->http_fails >= 5) { imcb_error(ic, "Fetch timeout (%d)", td->flags); imc_logout(ic, TRUE); + return FALSE; } } @@ -918,6 +919,8 @@ void twitter_get_timeline(struct im_connection *ic, gint64 next_cursor) if (include_mentions) { twitter_get_mentions(ic, next_cursor); } + + return TRUE; } /** diff --git a/protocols/twitter/twitter_lib.h b/protocols/twitter/twitter_lib.h index e593d229..7fd3b808 100644 --- a/protocols/twitter/twitter_lib.h +++ b/protocols/twitter/twitter_lib.h @@ -81,7 +81,7 @@ #define TWITTER_USER_STREAM_URL "https://userstream.twitter.com/1.1/user.json" gboolean twitter_open_stream(struct im_connection *ic); -void twitter_get_timeline(struct im_connection *ic, gint64 next_cursor); +gboolean twitter_get_timeline(struct im_connection *ic, gint64 next_cursor); void twitter_get_friends_ids(struct im_connection *ic, gint64 next_cursor); void twitter_get_statuses_friends(struct im_connection *ic, gint64 next_cursor); |