diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2011-08-17 22:58:21 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2011-08-17 22:58:21 +0100 |
commit | 5f1e78d41f68cccf3dc20af0982133dc0b4cc3bc (patch) | |
tree | 69c78a82a98a2a4214c83856b8752671d2cc922a /protocols/twitter/twitter.c | |
parent | 3d952b5cd5562889aa3b9594b7b88352ea30f78c (diff) | |
parent | d6b690624885f6bc34e5dfb9a84daa34a1adb7e6 (diff) |
To reduce ambiguity, allow using a # to specify Tweet ID's when doing retweets.
Patch from Jasper Spaans.
Diffstat (limited to 'protocols/twitter/twitter.c')
-rw-r--r-- | protocols/twitter/twitter.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/protocols/twitter/twitter.c b/protocols/twitter/twitter.c index 57a1ed80..fcbc88d7 100644 --- a/protocols/twitter/twitter.c +++ b/protocols/twitter/twitter.c @@ -490,7 +490,11 @@ static void twitter_handle_command(struct im_connection *ic, char *message) bee_user_t *bu; guint64 id; - if ((bu = bee_user_by_handle(ic->bee, ic, cmd[1])) && + if (g_str_has_prefix(cmd[1], "#")) { + id = g_ascii_strtoull(cmd[1] + 1, NULL, 10); + if (id < TWITTER_LOG_LENGTH && td->log) + id = td->log[id].id; + } else if ((bu = bee_user_by_handle(ic->bee, ic, cmd[1])) && (tud = bu->data) && tud->last_id) id = tud->last_id; else { |