aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/twitter/twitter.c
diff options
context:
space:
mode:
authorroger <roger@elvex.org.ar>2015-01-16 16:50:24 -0300
committerdequis <dx@dxzone.com.ar>2015-01-16 16:50:24 -0300
commit7549d0074aa4917e62106ac285b05baa1e76c1e9 (patch)
tree59180b84a6a987133c7b61185d3ff8dd4a87f83f /protocols/twitter/twitter.c
parent885d294fad822b5275a68127ab2ab925d1df1a0e (diff)
twitter: start stream from last tweet on connect/reconnect
This works by setting the last_tweet hidden account setting to the ID of the last shown tweet.
Diffstat (limited to 'protocols/twitter/twitter.c')
-rw-r--r--protocols/twitter/twitter.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/protocols/twitter/twitter.c b/protocols/twitter/twitter.c
index ca32b3ce..8e3fec77 100644
--- a/protocols/twitter/twitter.c
+++ b/protocols/twitter/twitter.c
@@ -50,6 +50,10 @@ static void twitter_main_loop_start(struct im_connection *ic)
{
struct twitter_data *td = ic->proto_data;
+ char *last_tweet = set_getstr(&ic->acc->set, "last_tweet");
+ if (last_tweet)
+ td->timeline_id = g_ascii_strtoull(last_tweet, NULL, 0);
+
/* Create the room now that we "logged in". */
if (td->flags & TWITTER_MODE_CHAT)
twitter_groupchat_init(ic);
@@ -326,6 +330,9 @@ static void twitter_init(account_t * acc)
s = set_add(&acc->set, "strip_newlines", "false", set_eval_bool, acc);
+ s = set_add(&acc->set, "last_tweet", "0", NULL, acc);
+ s->flags |= SET_HIDDEN;
+
if (strcmp(acc->prpl->name, "twitter") == 0) {
s = set_add(&acc->set, "stream", "true", set_eval_bool, acc);
s->flags |= ACC_SET_OFFLINE_ONLY;