diff options
author | Marius Halden <marius.h@lden.org> | 2015-11-08 16:46:16 +0100 |
---|---|---|
committer | Marius Halden <marius.h@lden.org> | 2016-05-07 14:26:16 +0200 |
commit | f0ff36f558329d096526004d4d912973bafd3904 (patch) | |
tree | 688a2b634a688c2b698774e72868b58882d724c1 /protocols/twitter/twitter.c | |
parent | e5f97d0aa477be05c2d9b1a6514d51e52ac394dc (diff) |
Add support for long tweet ids
Diffstat (limited to 'protocols/twitter/twitter.c')
-rw-r--r-- | protocols/twitter/twitter.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/protocols/twitter/twitter.c b/protocols/twitter/twitter.c index 63e7c599..82290f65 100644 --- a/protocols/twitter/twitter.c +++ b/protocols/twitter/twitter.c @@ -572,6 +572,8 @@ static void twitter_init(account_t * acc) s = set_add(&acc->set, "strip_newlines", "false", set_eval_bool, acc); + s = set_add(&acc->set, "long_ids", "false", set_eval_bool, acct); + s = set_add(&acc->set, "_last_tweet", "0", NULL, acc); s->flags |= SET_HIDDEN | SET_NOSAVE; @@ -649,7 +651,10 @@ static void twitter_login(account_t * acc) imcb_add_buddy(ic, name, NULL); imcb_buddy_status(ic, name, OPT_LOGGED_IN, NULL, NULL); - td->log = g_new0(struct twitter_log_data, TWITTER_LOG_LENGTH); + td->long_ids = set_getbool(&ic->acc->set, "long_ids"); + td->log_length = (td->long_ids) ? TWITTER_LONG_LOG_LENGTH : TWITTER_SHORT_LOG_LENGTH; + + td->log = g_new0(struct twitter_log_data, td->log_length); td->log_id = -1; s = set_getstr(&ic->acc->set, "mode"); @@ -894,7 +899,7 @@ static guint64 twitter_message_id_from_command_arg(struct im_connection *ic, cha if (arg[0] == '#') { arg++; } - if (parse_int64(arg, 16, &id) && id < TWITTER_LOG_LENGTH) { + if (parse_int64(arg, 16, &id) && id < td->log_length) { bu = td->log[id].bu; id = td->log[id].id; } else if (parse_int64(arg, 10, &id)) { |