diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-06-30 23:52:27 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-06-30 23:52:27 +0100 |
commit | 8203da9d2f792252d2144e5e9063391a3ceebfe9 (patch) | |
tree | 6a4487a5e2a151efaf0220d3711a0d5c6a6af4a4 /protocols/twitter/twitter_lib.c | |
parent | bd64716b5687e6652ada7112a43ff3455e32231e (diff) |
D'oh. Of course the getter functions should also treat next_cursor as a
64-bit integer. This code now successfully fetches lists with up to ~900
items. (Since this takes quite long, maybe there should be an upper limit.)
Diffstat (limited to 'protocols/twitter/twitter_lib.c')
-rw-r--r-- | protocols/twitter/twitter_lib.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/protocols/twitter/twitter_lib.c b/protocols/twitter/twitter_lib.c index f8efb711..d1b65c26 100644 --- a/protocols/twitter/twitter_lib.c +++ b/protocols/twitter/twitter_lib.c @@ -41,7 +41,7 @@ struct twitter_xml_list { int type; - int64_t next_cursor; + gint64 next_cursor; GSList *list; gpointer data; }; @@ -154,12 +154,12 @@ static void twitter_http_get_friends_ids(struct http_request *req); /** * Get the friends ids. */ -void twitter_get_friends_ids(struct im_connection *ic, int next_cursor) +void twitter_get_friends_ids(struct im_connection *ic, gint64 next_cursor) { // Primitive, but hey! It works... char* args[2]; args[0] = "cursor"; - args[1] = g_strdup_printf ("%d", next_cursor); + args[1] = g_strdup_printf ("%lld", (long long) next_cursor); twitter_http(ic, TWITTER_FRIENDS_IDS_URL, twitter_http_get_friends_ids, ic, 0, args, 2); g_free(args[1]); @@ -418,13 +418,13 @@ static void twitter_http_get_home_timeline(struct http_request *req); /** * Get the timeline. */ -void twitter_get_home_timeline(struct im_connection *ic, int next_cursor) +void twitter_get_home_timeline(struct im_connection *ic, gint64 next_cursor) { struct twitter_data *td = ic->proto_data; char* args[4]; args[0] = "cursor"; - args[1] = g_strdup_printf ("%d", next_cursor); + args[1] = g_strdup_printf ("%lld", (long long) next_cursor); if (td->home_timeline_id) { args[2] = "since_id"; args[3] = g_strdup_printf ("%llu", (long long unsigned int) td->home_timeline_id); @@ -670,11 +670,11 @@ static void twitter_http_get_statuses_friends(struct http_request *req) /** * Get the friends. */ -void twitter_get_statuses_friends(struct im_connection *ic, int next_cursor) +void twitter_get_statuses_friends(struct im_connection *ic, gint64 next_cursor) { char* args[2]; args[0] = "cursor"; - args[1] = g_strdup_printf ("%d", next_cursor); + args[1] = g_strdup_printf ("%lld", (long long) next_cursor); twitter_http(ic, TWITTER_SHOW_FRIENDS_URL, twitter_http_get_statuses_friends, ic, 0, args, 2); |