Mercurial > pidgin-twitter
diff twitter_api.c @ 347:33d2551727ba
embed "in reply to foo" link to each reply message
| author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
|---|---|
| date | Mon, 14 Dec 2009 20:14:31 +0900 |
| parents | 2e37e715e4a6 |
| children | ff078879e68e |
line wrap: on
line diff
--- a/twitter_api.c Mon Dec 14 15:07:52 2009 +0900 +++ b/twitter_api.c Mon Dec 14 20:14:31 2009 +0900 @@ -152,6 +152,18 @@ else if(!xmlStrcmp(nptr->name, (xmlChar *)"user")) { parse_user(nptr, st); } + else if(!xmlStrcmp(nptr->name, (xmlChar *)"in_reply_to_status_id")) { + gchar *str = (gchar *)xmlNodeGetContent(nptr); + st->in_reply_to_status_id = atoll(str); + twitter_debug("in_reply_to_status_id=%llu\n", (long long unsigned int)st->in_reply_to_status_id); + xmlFree(str); + } + else if(!xmlStrcmp(nptr->name, (xmlChar *)"in_reply_to_screen_name")) { + gchar *str = (gchar *)xmlNodeGetContent(nptr); + st->in_reply_to_screen_name = g_strdup(str); + twitter_debug("in_reply_to_screen_name=%s\n", st->in_reply_to_screen_name); + xmlFree(str); + } } } } @@ -163,6 +175,7 @@ g_free(st->text); g_free(st->screen_name); g_free(st->profile_image_url); + g_free(st->in_reply_to_screen_name); } static gboolean @@ -264,9 +277,11 @@ PurpleMessageFlags flag = PURPLE_MESSAGE_RECV; - msg = g_strdup_printf("%s: %s ptmsgid=%llu", + msg = g_strdup_printf("%s: %s pttag=%llu:%llu:%s", st->screen_name, st->text, - (long long unsigned int)st->id); + (long long unsigned int)st->id, + (long long unsigned int)st->in_reply_to_status_id, + st->in_reply_to_screen_name ? st->in_reply_to_screen_name : ""); /* apply filter */ if(purple_prefs_get_bool(OPT_FILTER)) { @@ -456,7 +471,7 @@ xmlFreeDoc(doc); xmlCleanupParser(); - m = g_strdup_printf("%s ptmsgid=%llu", + m = g_strdup_printf("%s pttag=%llu:0:", tm->status, (long long unsigned int)st->id);
