diff options
author | Zach Copley <zach@status.net> | 2010-02-22 01:23:24 -0800 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2010-02-22 01:23:24 -0800 |
commit | 35be39e30eacda1b0425a2ae9f8e58cd0867d157 (patch) | |
tree | df86f17a666e5d0bb775dbcef0fc4eb5b1c777f3 /plugins/OStatus/lib/salmonaction.php | |
parent | 47300a2ae9a51108fbf59a57cf5ab6e8867b54a6 (diff) | |
parent | 17ed30dffc1c05259baf2f0387089547e39684d7 (diff) |
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing
Diffstat (limited to 'plugins/OStatus/lib/salmonaction.php')
-rw-r--r-- | plugins/OStatus/lib/salmonaction.php | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/plugins/OStatus/lib/salmonaction.php b/plugins/OStatus/lib/salmonaction.php index 11c411c7d..4aba20cc4 100644 --- a/plugins/OStatus/lib/salmonaction.php +++ b/plugins/OStatus/lib/salmonaction.php @@ -173,13 +173,17 @@ class SalmonAction extends Action $html = $this->act->object->content; - $rendered = HTMLPurifier::purify($html); + $purifier = new HTMLPurifier(); + + $rendered = $purifier->purify($html); + $content = html_entity_decode(strip_tags($rendered)); $options = array('is_local' => Notice::REMOTE_OMB, 'uri' => $this->act->object->id, 'url' => $this->act->object->link, - 'rendered' => $rendered); + 'rendered' => $rendered, + 'replies' => $this->act->context->attention); if (!empty($this->act->context->location)) { $options['lat'] = $location->lat; @@ -199,12 +203,17 @@ class SalmonAction extends Action } if (!empty($this->act->time)) { - $options['created'] = common_sql_time($this->act->time); + $options['created'] = common_sql_date($this->act->time); } - return Notice::saveNew($oprofile->profile_id, - $content, - 'ostatus+salmon', - $options); + $saved = Notice::saveNew($oprofile->profile_id, + $content, + 'ostatus+salmon', + $options); + + // Record that this was saved through a validated Salmon source + // @fixme actually do the signature validation! + Ostatus_source::saveNew($saved, $oprofile, 'salmon'); + return $saved; } } |