From e8645dc9c3e511a1b30ea7f4c95ea176488a3ce2 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Fri, 10 Dec 2010 12:25:02 -0500 Subject: [PATCH] Use twitter's new id_str field from the JSON response. Required since twitter moved to their "SnowFlake" id generator - which produces 64bit unsigned integers. --- horde/services/twitter.php | 6 +++--- horde/templates/block/twitter_tweet.html.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/horde/services/twitter.php b/horde/services/twitter.php index f58825b2f..7f6e1d157 100644 --- a/horde/services/twitter.php +++ b/horde/services/twitter.php @@ -70,7 +70,7 @@ case 'getPage': } $html = ''; if (count($stream)) { - $newest = $stream[0]->id; + $newest = $stream[0]->id_str; } else { $newest = $params['since_id']; $oldest = 0; @@ -81,7 +81,7 @@ case 'getPage': foreach ($stream as $tweet) { /* Don't return the max_id tweet, since we already have it */ - if (!empty($params['max_id']) && $params['max_id'] == $tweet->id) { + if (!empty($params['max_id']) && $params['max_id'] == $tweet->id_str) { continue; } @@ -107,7 +107,7 @@ case 'getPage': $view->clientText = $filter->filter($tweet->source, 'xss'); $view->tweet = $tweet; $view->instanceid = $instance; - $oldest = $tweet->id; + $oldest = $tweet->id_str; $html .= $view->render('twitter_tweet'); } diff --git a/horde/templates/block/twitter_tweet.html.php b/horde/templates/block/twitter_tweet.html.php index 8664a72a0..83d9162e8 100644 --- a/horde/templates/block/twitter_tweet.html.php +++ b/horde/templates/block/twitter_tweet.html.php @@ -31,8 +31,8 @@
- link(array('onclick' => 'Horde[\'twitter' . $this->instanceid . '\'].buildReply(\'' . $this->tweet->id . '\', \'' . $this->tweet->user->screen_name . '\', \'' . $this->tweet->user->name . '\'); return false;')) . _("Reply") ?> -  |  link(array('onclick' => 'Horde[\'twitter' . $this->instanceid . '\'].retweet(\'' . $this->tweet->id . '\'); return false;')) . _("Retweet") ?> + link(array('onclick' => 'Horde[\'twitter' . $this->instanceid . '\'].buildReply(\'' . (string)$this->tweet->id_str . '\', \'' . $this->tweet->user->screen_name . '\', \'' . $this->tweet->user->name . '\'); return false;')) . _("Reply") ?> +  |  link(array('onclick' => 'Horde[\'twitter' . $this->instanceid . '\'].retweet(\'' . (string)$this->tweet->id_str . '\'); return false;')) . _("Retweet") ?>
 
-- 2.11.0