Skip to content
Snippets Groups Projects
Unverified Commit 05e1ec81 authored by Robb Lewis's avatar Robb Lewis
Browse files

Show in reply to

parent a1e57b41
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -54,4 +54,14 @@ class Tweet extends Model
{
return unserialize(str_replace("O:16:\"SimpleXMLElement\"", "O:8:\"stdClass\"", $place));
}
public function getReplyAttribute()
{
if ($this->type != TweetType::TYPE_REPLY) return false;
return [
'id' => $this->extra['in_reply_to_status_id_str'],
'username' => $this->extra['in_reply_to_screen_name'],
];
}
}
Loading
Loading
@@ -43,6 +43,12 @@ class TweetPresenter extends Presenter {
if ($this->place)
$metadata = $metadata . ' from <a href="http://maps.google.com/?q='.urlencode($this->place->full_name) .'">' . $this->place->full_name . '</a>';
 
if ($replyData = $this->reply)
{
$metadata = $metadata . ' in <a href="https://twitter.com/statuses/' . $replyData['id'] . '">reply to @' . $replyData['username'] . '</a>';
}
return $metadata;
}
}
\ No newline at end of file
<?php
namespace App\Tweets;
class TweetType {
const TYPE_TWEET = 0;
const TYPE_REPLY = 1;
const TYPE_RETWEET = 2;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment