Changeset aa2f575
- Timestamp:
- 2011-08-17T22:21:47Z (13 years ago)
- Branches:
- master
- Children:
- fd1ca44
- Parents:
- 5f1e78d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/twitter/twitter.c
r5f1e78d raa2f575 465 465 guint64 id; 466 466 467 if (cmd[1]) 468 id = g_ascii_strtoull(cmd[1], NULL, 10); 469 else 470 id = td->last_status_id; 471 472 /* TODO: User feedback. */ 473 if (id) 467 if (cmd[1] == NULL) 468 twitter_status_destroy(ic, td->last_status_id); 469 else if (sscanf(cmd[1], "%" G_GUINT64_FORMAT, &id) == 1) { 470 if (id < TWITTER_LOG_LENGTH && td->log) 471 id = td->log[id].id; 472 474 473 twitter_status_destroy(ic, id); 475 else474 } else 476 475 twitter_msg(ic, "Could not undo last action"); 477 476 … … 491 490 guint64 id; 492 491 493 if (g_str_has_prefix(cmd[1], "#") ) {494 id = g_ascii_strtoull(cmd[1] + 1, NULL, 10);492 if (g_str_has_prefix(cmd[1], "#") && 493 sscanf(cmd[1] + 1, "%" G_GUINT64_FORMAT, &id) == 1) { 495 494 if (id < TWITTER_LOG_LENGTH && td->log) 496 495 id = td->log[id].id; … … 498 497 (tud = bu->data) && tud->last_id) 499 498 id = tud->last_id; 500 else { 501 id = g_ascii_strtoull(cmd[1], NULL, 10); 499 else if (sscanf(cmd[1], "%" G_GUINT64_FORMAT, &id) == 1){ 502 500 if (id < TWITTER_LOG_LENGTH && td->log) 503 501 id = td->log[id].id; … … 518 516 guint64 id = 0; 519 517 520 if ((bu = bee_user_by_handle(ic->bee, ic, cmd[1])) && 518 if (g_str_has_prefix(cmd[1], "#") && 519 sscanf(cmd[1] + 1, "%" G_GUINT64_FORMAT, &id) == 1 && 520 (id < TWITTER_LOG_LENGTH) && td->log) { 521 bu = td->log[id].bu; 522 if (g_slist_find(ic->bee->users, bu)) 523 id = td->log[id].id; 524 else 525 bu = NULL; 526 } else if ((bu = bee_user_by_handle(ic->bee, ic, cmd[1])) && 521 527 (tud = bu->data) && tud->last_id) { 522 528 id = tud->last_id; … … 529 535 bu = NULL; 530 536 } 537 531 538 if (!id || !bu) { 532 539 twitter_msg(ic, "User `%s' does not exist or didn't "
Note: See TracChangeset
for help on using the changeset viewer.