From: Enlightenment S. <no-...@en...> - 2010-05-09 20:29:01
|
Log: Only parse a timeline if the http response code was 200 OK. Sync default message string so accidents like http://identi.ca/notice/31621131 don't happen. Author: rui Date: 2010-05-09 13:28:54 -0700 (Sun, 09 May 2010) New Revision: 48725 Modified: trunk/elmdentica/src/elmdentica.c trunk/elmdentica/src/twitter.c Modified: trunk/elmdentica/src/elmdentica.c =================================================================== --- trunk/elmdentica/src/elmdentica.c 2010-05-09 19:03:23 UTC (rev 48724) +++ trunk/elmdentica/src/elmdentica.c 2010-05-09 20:28:54 UTC (rev 48725) @@ -1346,7 +1346,7 @@ elm_box_pack_end(box2, count); entry = elm_entry_add(win); - elm_entry_entry_set(entry, _("Press here to start typing your message...")); + elm_entry_entry_set(entry, _("Type your status here...")); elm_entry_single_line_set(entry, 0); elm_entry_line_wrap_set(entry, 1); evas_object_size_hint_weight_set(entry, 1, 0); Modified: trunk/elmdentica/src/twitter.c =================================================================== --- trunk/elmdentica/src/twitter.c 2010-05-09 19:03:23 UTC (rev 48724) +++ trunk/elmdentica/src/twitter.c 2010-05-09 20:28:54 UTC (rev 48725) @@ -212,21 +212,25 @@ ed_curl_get(screen_name, password, request, account_id); - ed_twitter_init_friends(); - xmlSubstituteEntitiesDefault(1); + if(request->response_code == 200) { + ed_twitter_init_friends(); + xmlSubstituteEntitiesDefault(1); - xml_res = xmlSAXUserParseMemory(&saxHandler, (void*)statuses, request->content.memory, request->content.size); + xml_res = xmlSAXUserParseMemory(&saxHandler, (void*)statuses, request->content.memory, request->content.size); - if(xml_res != 0) { - fprintf(stderr,_("FAILED TO SAX FRIENDS: %d\n"),xml_res); - if (debug) fprintf(stderr,"%s\n",request->content.memory); - } + if(xml_res != 0) { + fprintf(stderr,_("FAILED TO SAX FRIENDS: %d\n"),xml_res); + if (debug) fprintf(stderr,"%s\n",request->content.memory); + } - if(statuses->state != HASH) { - now = time(NULL); - messages_insert(account_id, statuses->list, timeline); + if(statuses->state != HASH) { + now = time(NULL); + messages_insert(account_id, statuses->list, timeline); + } else { + //show_error(statuses); + } } else { - //show_error(statuses); + printf("http response code was %ld\n", request->response_code); } } |