add in_reply_to link and make HTML in source work correctly
This commit is contained in:
parent
1a61a171cd
commit
5affe093ab
@ -158,6 +158,15 @@ class CometPlugin extends Plugin
|
||||
$arr = $act->twitter_status_array($notice, true);
|
||||
$arr['url'] = $notice->bestUrl();
|
||||
$arr['html'] = htmlspecialchars($notice->rendered);
|
||||
$arr['source'] = htmlspecialchars($arr['source']);
|
||||
|
||||
if (!empty($notice->reply_to)) {
|
||||
$reply_to = Notice::staticGet('id', $notice->reply_to);
|
||||
if (!empty($reply_to)) {
|
||||
$arr['in_reply_to_status_url'] = $reply_to->bestUrl();
|
||||
}
|
||||
$reply_to = null;
|
||||
}
|
||||
|
||||
$profile = $notice->getProfile();
|
||||
$arr['user']['profile_url'] = $profile->profileurl;
|
||||
|
@ -54,7 +54,8 @@ var updater = function()
|
||||
function makeNoticeItem(data)
|
||||
{
|
||||
user = data['user'];
|
||||
html = data['html'].replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
|
||||
html = data['html'].replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"');
|
||||
source = data['source'].replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"');
|
||||
|
||||
ni = "<li class=\"hentry notice\" id=\"notice-"+data['id']+"\">"+
|
||||
"<div class=\"entry-title\">"+
|
||||
@ -77,9 +78,19 @@ var updater = function()
|
||||
"</dl>"+
|
||||
"<dl class=\"device\">"+
|
||||
"<dt>From</dt> "+
|
||||
"<dd>"+data['source']+"</dd>"+
|
||||
"</dl>"+
|
||||
"</div>"+
|
||||
"<dd>"+source+"</dd>"+ // may have a link, I think
|
||||
"</dl>";
|
||||
|
||||
if (data['in_reply_to_status_id']) {
|
||||
ni = ni+" <dl class=\"response\">"+
|
||||
"<dt>To</dt>"+
|
||||
"<dd>"+
|
||||
"<a href=\""+data['in_reply_to_status_url']+"\" rel=\"in-reply-to\">in reply to</a>"+
|
||||
"</dd>"+
|
||||
"</dl>";
|
||||
}
|
||||
|
||||
ni = ni+"</div>"+
|
||||
"<div class=\"notice-options\">";
|
||||
|
||||
if (_userid != 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user