changeset 305:227e59f017f2

status id now exceeds int32 limit.
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Sat, 13 Jun 2009 17:54:39 +0900
parents 6c8942296a47
children 13b268d9d034
files pidgin-twitter.h twitter_api.c
diffstat 2 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin-twitter.h	Sat Jun 13 15:45:10 2009 +0900
+++ b/pidgin-twitter.h	Sat Jun 13 17:54:39 2009 +0900
@@ -93,7 +93,7 @@
     gchar *screen_name;
     gchar *profile_image_url;
     time_t time;
-    guint id;
+    guint64 id;
 } status_t;
 
 typedef struct _source {
--- a/twitter_api.c	Sat Jun 13 15:45:10 2009 +0900
+++ b/twitter_api.c	Sat Jun 13 17:54:39 2009 +0900
@@ -9,7 +9,7 @@
 static void parse_status(xmlNode *status, status_t *st);
 
 static void free_status(status_t *st);
-static gboolean is_posted_message(status_t *status, guint lastid);
+static gboolean is_posted_message(status_t *status, guint64 lastid);
 static void get_status_with_api_cb(PurpleUtilFetchUrlData *url_data, gpointer user_data, const gchar *url_text, size_t len, const gchar *error_message);
 static void post_status_with_api_cb(PurpleUtilFetchUrlData *url_data, gpointer user_data, const gchar *url_text, size_t len, const gchar *error_message);
 
@@ -32,6 +32,7 @@
             if(!xmlStrcmp(nptr->name, (xmlChar *)"screen_name")) {
                 gchar *str = (gchar *)xmlNodeGetContent(nptr);
                 st->screen_name = g_strdup(str);
+                twitter_debug("screen_name=%s\n", st->screen_name);
                 xmlFree(str);
             }
             else if(!xmlStrcmp(nptr->name, (xmlChar *)"profile_image_url")) {
@@ -136,7 +137,8 @@
             }
             else if(!xmlStrcmp(nptr->name, (xmlChar *)"id")) {
                 gchar *str = (gchar *)xmlNodeGetContent(nptr);
-                st->id = atoi(str);
+                st->id = atoll(str);
+                twitter_debug("id=%lld\n", st->id);
                 xmlFree(str);
             }
             else if(!xmlStrcmp(nptr->name, (xmlChar *)"text")) {
@@ -161,7 +163,7 @@
 }
 
 static gboolean
-is_posted_message(status_t *status, guint lastid)
+is_posted_message(status_t *status, guint64 lastid)
 {
     GList *pp = g_list_first(postedlist);
     gboolean rv = FALSE;
@@ -196,7 +198,7 @@
 {
     xmlDocPtr doc;
     xmlNode *nptr, *nptr2;
-    static guint lastid = 0;
+    static guint64 lastid = 0;
     PurpleConversation *conv;
     GList *stp;
     const gchar *start;
@@ -261,7 +263,7 @@
 
              msg = g_strdup_printf("%s: %s", st->screen_name, st->text);
 
-             /* apply filter*/
+             /* apply filter */
              if(purple_prefs_get_bool(OPT_FILTER)) {
                  apply_filter(&sender, &msg, &flag, twitter_service);
              }