Changeset eb4ad8d for protocols/twitter
- Timestamp:
- 2015-01-17T20:13:19Z (10 years ago)
- Branches:
- master
- Children:
- e26aa72
- Parents:
- 1065dd4 (diff), 664bac3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- protocols/twitter
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/twitter/twitter.c
r1065dd4 reb4ad8d 51 51 struct twitter_data *td = ic->proto_data; 52 52 53 char *last_tweet = set_getstr(&ic->acc->set, "_last_tweet"); 54 if (last_tweet) 55 td->timeline_id = g_ascii_strtoull(last_tweet, NULL, 0); 56 53 57 /* Create the room now that we "logged in". */ 54 58 if (td->flags & TWITTER_MODE_CHAT) … … 327 331 s = set_add(&acc->set, "strip_newlines", "false", set_eval_bool, acc); 328 332 333 s = set_add(&acc->set, "_last_tweet", "0", NULL, acc); 334 s->flags |= SET_HIDDEN | SET_NOSAVE; 335 329 336 if (strcmp(acc->prpl->name, "twitter") == 0) { 330 337 s = set_add(&acc->set, "stream", "true", set_eval_bool, acc); -
protocols/twitter/twitter_lib.c
r1065dd4 reb4ad8d 234 234 void twitter_get_friends_ids(struct im_connection *ic, gint64 next_cursor) 235 235 { 236 // Primitive, but hey! It works... 236 // Primitive, but hey! It works... 237 237 char *args[2]; 238 238 args[0] = "cursor"; 239 args[1] = g_strdup_printf("% lld", (long long)next_cursor);239 args[1] = g_strdup_printf("%" G_GINT64_FORMAT, next_cursor); 240 240 twitter_http(ic, TWITTER_FRIENDS_IDS_URL, twitter_http_get_friends_ids, ic, 0, args, 2); 241 241 … … 721 721 { 722 722 struct twitter_data *td = ic->proto_data; 723 char *last_id_str; 723 724 724 725 if (status->user == NULL || status->text == NULL) … … 738 739 // we won't pick up the updates already in the list. 739 740 td->timeline_id = MAX(td->timeline_id, status->rt_id); 741 742 last_id_str = g_strdup_printf("%" G_GUINT64_FORMAT, td->timeline_id); 743 set_setstr(&ic->acc->set, "last_tweet", last_id_str); 744 g_free(last_id_str); 740 745 } 741 746 … … 997 1002 char *args[6]; 998 1003 args[0] = "cursor"; 999 args[1] = g_strdup_printf("% lld", (long long)next_cursor);1004 args[1] = g_strdup_printf("%" G_GINT64_FORMAT, next_cursor); 1000 1005 args[2] = "include_entities"; 1001 1006 args[3] = "true"; 1002 1007 if (td->timeline_id) { 1003 1008 args[4] = "since_id"; 1004 args[5] = g_strdup_printf("% llu", (long long unsigned int)td->timeline_id);1009 args[5] = g_strdup_printf("%" G_GUINT64_FORMAT, td->timeline_id); 1005 1010 } 1006 1011 … … 1033 1038 char *args[6]; 1034 1039 args[0] = "cursor"; 1035 args[1] = g_strdup_printf("% lld", (long long)next_cursor);1040 args[1] = g_strdup_printf("%" G_GINT64_FORMAT, next_cursor); 1036 1041 args[2] = "include_entities"; 1037 1042 args[3] = "true"; 1038 1043 if (td->timeline_id) { 1039 1044 args[4] = "since_id"; 1040 args[5] = g_strdup_printf("% llu", (long long unsigned int)td->timeline_id);1045 args[5] = g_strdup_printf("%" G_GUINT64_FORMAT, td->timeline_id); 1041 1046 } else { 1042 1047 args[4] = "count"; … … 1167 1172 "status", msg, 1168 1173 "in_reply_to_status_id", 1169 g_strdup_printf("% llu", (unsigned long long)in_reply_to)1174 g_strdup_printf("%" G_GUINT64_FORMAT, in_reply_to) 1170 1175 }; 1171 1176 twitter_http(ic, TWITTER_STATUS_UPDATE_URL, twitter_http_post, ic, 1, … … 1201 1206 { 1202 1207 char *url; 1203 url = g_strdup_printf("%s% llu%s", TWITTER_STATUS_DESTROY_URL,1204 (unsigned long long)id, ".json");1208 url = g_strdup_printf("%s%" G_GUINT64_FORMAT "%s", 1209 TWITTER_STATUS_DESTROY_URL, id, ".json"); 1205 1210 twitter_http_f(ic, url, twitter_http_post, ic, 1, NULL, 0, 1206 1211 TWITTER_HTTP_USER_ACK); … … 1211 1216 { 1212 1217 char *url; 1213 url = g_strdup_printf("%s% llu%s", TWITTER_STATUS_RETWEET_URL,1214 (unsigned long long)id, ".json");1218 url = g_strdup_printf("%s%" G_GUINT64_FORMAT "%s", 1219 TWITTER_STATUS_RETWEET_URL, id, ".json"); 1215 1220 twitter_http_f(ic, url, twitter_http_post, ic, 1, NULL, 0, 1216 1221 TWITTER_HTTP_USER_ACK); … … 1241 1246 NULL, 1242 1247 }; 1243 args[1] = g_strdup_printf("% llu", (unsigned long long)id);1248 args[1] = g_strdup_printf("%" G_GUINT64_FORMAT, id); 1244 1249 twitter_http_f(ic, TWITTER_FAVORITE_CREATE_URL, twitter_http_post, 1245 1250 ic, 1, args, 2, TWITTER_HTTP_USER_ACK);
Note: See TracChangeset
for help on using the changeset viewer.