Commit 12774635 authored by Damien McKenna's avatar Damien McKenna
Browse files

Issue #1929126 by colin_vanarts, leewillis77, AdamPS, DamienMcKenna: Store the...

Issue #1929126 by colin_vanarts, leewillis77, AdamPS, DamienMcKenna: Store the entire message for retweets.
parent f7d1a920
Loading
Loading
Loading
Loading
+2 −0
Changes for CHANGELOG.txt: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -11,6 +11,8 @@ By DamienMcKenna: Initial CHANGELOG.txt file.
  hook_requirements().
#2205277 by AdamPS: Do not convert in_reply_to_user_id field to integer when it
  must allow larger values.
#1929126 by colin_vanarts, leewillis77, AdamPS, DamienMcKenna: Store the entire
  message for retweets.


Twitter 6.x-5.1, 2013-04-19
+6 −1
Changes for twitter.inc: 6 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -132,11 +132,16 @@ function twitter_load_authenticated_accounts() {
 * Saves a TwitterStatus object to {twitter}
 */
function twitter_status_save($status) {
  $text = $status->text;
  if (!empty($status->retweeted_status)) {
    $text = 'RT @' . $status->retweeted_status->user->screen_name . ': ' . $text;
  }

  $row = array(
    'twitter_id' => $status->id,
    'screen_name' => $status->user->screen_name,
    'created_time' => strtotime($status->created_at),
    'text' => $status->text,
    'text' => $text,
    'source' => $status->source,
    'in_reply_to_status_id' => ($status->in_reply_to_status_id > 0) ? (string) $status->in_reply_to_status_id : NULL,
    'in_reply_to_user_id' => $status->in_reply_to_user_id,
+7 −0
Changes for twitter.lib.php: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -1264,6 +1264,8 @@ class TwitterStatus {

  public $user;

  public $retweeted_status;

  /**
   * Constructor for TwitterStatus
   */
@@ -1280,6 +1282,11 @@ class TwitterStatus {
    if (isset($values['user'])) {
      $this->user = new TwitterUser($values['user']);
    }

    // Load full retweeted_status (original tweet) if retweet detected.
    if (isset($values['retweeted_status'])) {
      $this->retweeted_status = new TwitterStatus($values['retweeted_status']);
    }
  }
}