Changeset 8203da9


Ignore:
Timestamp:
2010-06-30T22:52:27Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
3353b5e, c351434
Parents:
bd64716
Message:

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

Location:
protocols/twitter
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • protocols/twitter/twitter_lib.c

    rbd64716 r8203da9  
    4242struct twitter_xml_list {
    4343        int type;
    44         int64_t next_cursor;
     44        gint64 next_cursor;
    4545        GSList *list;
    4646        gpointer data;
     
    155155 * Get the friends ids.
    156156 */
    157 void twitter_get_friends_ids(struct im_connection *ic, int next_cursor)
     157void twitter_get_friends_ids(struct im_connection *ic, gint64 next_cursor)
    158158{
    159159        // Primitive, but hey! It works...     
    160160        char* args[2];
    161161        args[0] = "cursor";
    162         args[1] = g_strdup_printf ("%d", next_cursor);
     162        args[1] = g_strdup_printf ("%lld", (long long) next_cursor);
    163163        twitter_http(ic, TWITTER_FRIENDS_IDS_URL, twitter_http_get_friends_ids, ic, 0, args, 2);
    164164
     
    419419 * Get the timeline.
    420420 */
    421 void twitter_get_home_timeline(struct im_connection *ic, int next_cursor)
     421void twitter_get_home_timeline(struct im_connection *ic, gint64 next_cursor)
    422422{
    423423        struct twitter_data *td = ic->proto_data;
     
    425425        char* args[4];
    426426        args[0] = "cursor";
    427         args[1] = g_strdup_printf ("%d", next_cursor);
     427        args[1] = g_strdup_printf ("%lld", (long long) next_cursor);
    428428        if (td->home_timeline_id) {
    429429                args[2] = "since_id";
     
    671671 * Get the friends.
    672672 */
    673 void twitter_get_statuses_friends(struct im_connection *ic, int next_cursor)
     673void twitter_get_statuses_friends(struct im_connection *ic, gint64 next_cursor)
    674674{
    675675        char* args[2];
    676676        args[0] = "cursor";
    677         args[1] = g_strdup_printf ("%d", next_cursor);
     677        args[1] = g_strdup_printf ("%lld", (long long) next_cursor);
    678678
    679679        twitter_http(ic, TWITTER_SHOW_FRIENDS_URL, twitter_http_get_statuses_friends, ic, 0, args, 2);
  • protocols/twitter/twitter_lib.h

    rbd64716 r8203da9  
    7676#define TWITTER_BLOCKS_DESTROY_URL "/blocks/destroy/"
    7777
    78 void twitter_get_friends_ids(struct im_connection *ic, int next_cursor);
    79 void twitter_get_home_timeline(struct im_connection *ic, int next_cursor);
    80 void twitter_get_statuses_friends(struct im_connection *ic, int next_cursor);
     78void twitter_get_friends_ids(struct im_connection *ic, gint64 next_cursor);
     79void twitter_get_home_timeline(struct im_connection *ic, gint64 next_cursor);
     80void twitter_get_statuses_friends(struct im_connection *ic, gint64 next_cursor);
    8181
    8282void twitter_post_status(struct im_connection *ic, char *msg);
Note: See TracChangeset for help on using the changeset viewer.