From: Evan Prodromou Date: Fri, 1 May 2009 15:39:47 +0000 (-0700) Subject: add in_reply_to link and make HTML in source work correctly X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5affe093aba97a0e4ac559b685a240d568929ffb;p=quix0rs-gnu-social.git add in_reply_to link and make HTML in source work correctly --- diff --git a/plugins/Comet/CometPlugin.php b/plugins/Comet/CometPlugin.php index 48ac9dcad6..0f2fcd701d 100644 --- a/plugins/Comet/CometPlugin.php +++ b/plugins/Comet/CometPlugin.php @@ -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; diff --git a/plugins/Comet/updatetimeline.js b/plugins/Comet/updatetimeline.js index e89b3bddf7..170949e9ba 100644 --- a/plugins/Comet/updatetimeline.js +++ b/plugins/Comet/updatetimeline.js @@ -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 = "
  • "+ "
    "+ @@ -77,9 +78,19 @@ var updater = function() ""+ "
    "+ "
    From
    "+ - "
    "+data['source']+"
    "+ - "
    "+ - "
    "+ + "
    "+source+"
    "+ // may have a link, I think + ""; + + if (data['in_reply_to_status_id']) { + ni = ni+"
    "+ + "
    To
    "+ + "
    "+ + "in reply to"+ + "
    "+ + "
    "; + } + + ni = ni+""+ "
    "; if (_userid != 0) {