diff options
Diffstat (limited to 'protocols/twitter/twitter.c')
-rw-r--r-- | protocols/twitter/twitter.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/protocols/twitter/twitter.c b/protocols/twitter/twitter.c index 4debc08a..7f5e0368 100644 --- a/protocols/twitter/twitter.c +++ b/protocols/twitter/twitter.c @@ -858,23 +858,6 @@ static void twitter_buddy_data_free(struct bee_user *bu) g_free(bu->data); } -/* Parses a decimal or hex tweet ID, returns TRUE on success */ -static gboolean twitter_parse_id(char *string, int base, guint64 *id) -{ - guint64 parsed; - char *endptr; - - errno = 0; - parsed = g_ascii_strtoull(string, &endptr, base); - if (errno || endptr == string || *endptr != '\0') { - return FALSE; - } - *id = parsed; - return TRUE; -} - -bee_user_t twitter_log_local_user; - /** Convert the given bitlbee tweet ID, bitlbee username, or twitter tweet ID * into a twitter tweet ID. * @@ -902,10 +885,10 @@ static guint64 twitter_message_id_from_command_arg(struct im_connection *ic, cha if (arg[0] == '#') { arg++; } - if (twitter_parse_id(arg, 16, &id) && id < TWITTER_LOG_LENGTH) { + if (parse_int64(arg, 16, &id) && id < TWITTER_LOG_LENGTH) { bu = td->log[id].bu; id = td->log[id].id; - } else if (twitter_parse_id(arg, 10, &id)) { + } else if (parse_int64(arg, 10, &id)) { /* Allow normal tweet IDs as well; not a very useful feature but it's always been there. Just ignore very low IDs to avoid accidents. */ |