Index: twitter_request.h =================================================================== --- twitter_request.h (revision 37) +++ twitter_request.h (working copy) @@ -57,10 +57,10 @@ void twitter_send_request_multipage(PurpleAccount *account, const char *url, const char *query_string, TwitterSendRequestMultiPageSuccessFunc success_callback, TwitterSendRequestMultiPageErrorFunc error_callback, - int expected_count, gpointer data); + long long expected_count, gpointer data); void twitter_send_request_multipage_all(PurpleAccount *account, const char *url, const char *query_string, TwitterSendRequestMultiPageAllSuccessFunc success_callback, TwitterSendRequestMultiPageAllErrorFunc error_callback, - int expected_count, gpointer data); + long long expected_count, gpointer data); Index: twitter_api.h =================================================================== --- twitter_api.h (revision 37) +++ twitter_api.h (working copy) @@ -4,15 +4,15 @@ gpointer data); void twitter_api_get_replies_all(PurpleAccount *account, - unsigned int since_id, + long long since_id, TwitterSendRequestMultiPageAllSuccessFunc success_func, TwitterSendRequestMultiPageAllErrorFunc error_func, gpointer data); void twitter_api_get_replies(PurpleAccount *account, - unsigned int since_id, - unsigned int count, - unsigned int page, + long long since_id, + long long count, + long long page, TwitterSendRequestSuccessFunc success_func, TwitterSendRequestErrorFunc error_func, gpointer data); Index: twitter.c =================================================================== --- twitter.c (revision 37) +++ twitter.c (working copy) @@ -39,7 +39,7 @@ struct _TwitterUserData { PurpleAccount *account; - int id; + long long id; char *name; char *screen_name; char *profile_image_url; @@ -49,7 +49,7 @@ struct _TwitterStatusData { char *text; - int id; + long long id; time_t created_at; }; @@ -63,29 +63,39 @@ { guint get_replies_timer; guint get_friends_timer; - gint last_reply_id; - gint failed_get_replies_count; + long long last_reply_id; + long long failed_get_replies_count; } TwitterConnectionData; -static int twitter_account_get_last_reply_id(PurpleAccount *account) +static long long twitter_account_get_last_reply_id(PurpleAccount *account) { - return purple_account_get_int(account, "twitter_last_reply_id", 0); + const char* tmp_str; + + tmp_str = purple_account_get_string(account, "twitter_last_reply_id", NULL); + if(tmp_str) + return strtoll(tmp_str, NULL, 10); + else + return 0; } -static void twitter_account_set_last_reply_id(PurpleAccount *account, int reply_id) +static void twitter_account_set_last_reply_id(PurpleAccount *account, long long reply_id) { - purple_account_set_int(account, "twitter_last_reply_id", reply_id); + gchar* tmp_str; + + tmp_str = g_strdup_printf("%lld", reply_id); + purple_account_set_string(account, "twitter_last_reply_id", tmp_str); + g_free(tmp_str); } -static int twitter_connection_get_last_reply_id(PurpleConnection *gc) +static long long twitter_connection_get_last_reply_id(PurpleConnection *gc) { - int reply_id = 0; + long long reply_id = 0; TwitterConnectionData *connection_data = gc->proto_data; reply_id = connection_data->last_reply_id; return (reply_id ? reply_id : twitter_account_get_last_reply_id(purple_connection_get_account(gc))); } -static void twitter_connection_set_last_reply_id(PurpleConnection *gc, int reply_id) +static void twitter_connection_set_last_reply_id(PurpleConnection *gc, long long reply_id) { TwitterConnectionData *connection_data = gc->proto_data; connection_data->last_reply_id = reply_id; @@ -428,7 +438,7 @@ if ((data = xmlnode_get_child_data(status_node, "id"))) { - status->id =atoi(data); + status->id = strtoll(data, NULL, 10); g_free(data); } @@ -830,7 +840,10 @@ static void twitter_request_id_ok(PurpleConnection *gc, PurpleRequestFields *fields) { PurpleAccount *acct = purple_connection_get_account(gc); - int id = purple_request_fields_get_integer(fields, "id"); + const char* str = purple_request_fields_get_string(fields, "id"); + long long id = 0; + if(str) + id = strtoll(str, NULL, 10); twitter_api_get_replies_all(acct, id, twitter_get_replies_cb, NULL, NULL); } static void twitter_action_get_replies(PurplePluginAction *action) @@ -842,7 +855,9 @@ group = purple_request_field_group_new(NULL); - field = purple_request_field_int_new("id", ("Minutes"), twitter_connection_get_last_reply_id(gc)); + gchar* str = g_strdup_printf("%lld", twitter_connection_get_last_reply_id(gc)); + field = purple_request_field_string_new("id", ("Minutes"), str, FALSE); + g_free(str); purple_request_field_group_add_field(group, field); request = purple_request_fields_new(); @@ -1334,7 +1349,7 @@ PURPLE_PRIORITY_DEFAULT, /* priority */ TWITTER_PROTOCOL_ID, /* id */ "Twitter Protocol", /* name */ - "0.1", /* version */ + "0.2", /* version */ "Twitter Protocol Plugin", /* summary */ "Twitter Protocol Plugin", /* description */ "neaveru ", /* author */ Index: twitter_request.c =================================================================== --- twitter_request.c (revision 37) +++ twitter_request.c (working copy) @@ -52,8 +52,8 @@ char *query_string; TwitterSendRequestMultiPageSuccessFunc success_callback; TwitterSendRequestMultiPageErrorFunc error_callback; - int page; - int expected_count; + long long page; + long long expected_count; } TwitterMultiPageRequestData; typedef struct @@ -213,7 +213,7 @@ void twitter_send_request_multipage_do(PurpleAccount *account, TwitterMultiPageRequestData *request_data) { - char *full_query_string = g_strdup_printf("%s%spage=%d", + char *full_query_string = g_strdup_printf("%s%spage=%lld", request_data->query_string ? request_data->query_string : "", request_data->query_string && strlen(request_data->query_string) > 0 ? "&" : "", request_data->page); @@ -230,7 +230,7 @@ const char *url, const char *query_string, TwitterSendRequestMultiPageSuccessFunc success_callback, TwitterSendRequestMultiPageErrorFunc error_callback, - int expected_count, gpointer data) + long long expected_count, gpointer data) { TwitterMultiPageRequestData *request_data = g_new0(TwitterMultiPageRequestData, 1); request_data->user_data = data; @@ -279,7 +279,7 @@ const char *url, const char *query_string, TwitterSendRequestMultiPageAllSuccessFunc success_callback, TwitterSendRequestMultiPageAllErrorFunc error_callback, - int expected_count, gpointer data) + long long expected_count, gpointer data) { TwitterMultiPageAllRequestData *request_data_all = g_new0(TwitterMultiPageAllRequestData, 1); request_data_all->success_callback = success_callback; Index: twitter_api.c =================================================================== --- twitter_api.c (revision 37) +++ twitter_api.c (working copy) @@ -75,17 +75,17 @@ } void twitter_api_get_replies(PurpleAccount *account, - unsigned int since_id, - unsigned int count, - unsigned int page, + long long since_id, + long long count, + long long page, TwitterSendRequestSuccessFunc success_func, TwitterSendRequestErrorFunc error_func, gpointer data) { //blah char *query = since_id ? - g_strdup_printf("count=%d&page=%dsince_id=%d", count, page, since_id) : - g_strdup_printf("count=%d&page=%d", count, page); + g_strdup_printf("count=%lld&page=%lldsince_id=%lld", count, page, since_id) : + g_strdup_printf("count=%lld&page=%lld", count, page); twitter_send_request(account, FALSE, "/statuses/replies.xml", query, @@ -94,7 +94,7 @@ g_free(query); } void twitter_api_get_replies_all(PurpleAccount *account, - unsigned int since_id, + long long since_id, TwitterSendRequestMultiPageAllSuccessFunc success_func, TwitterSendRequestMultiPageAllErrorFunc error_func, gpointer data) @@ -102,7 +102,7 @@ int count = 20; //why strdup? char *query = since_id ? - g_strdup_printf("since_id=%d", since_id) : + g_strdup_printf("since_id=%lld", since_id) : g_strdup(""); twitter_send_request_multipage_all(account,