From: Michael J. Rubinsky Date: Fri, 10 Dec 2010 17:25:02 +0000 (-0500) Subject: Use twitter's new id_str field from the JSON response. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=e8645dc9c3e511a1b30ea7f4c95ea176488a3ce2;p=horde.git 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. --- 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") ?>