/* The current authenticated user */
protected $cur;
+ protected $scoped = null;
/* Title of the document */
protected $title;
{
parent::__construct($items, $url);
- $this->cur = $cur;
+ $this->cur = $cur ?: common_current_user();
+ $this->scoped = !is_null($this->cur) ? $this->cur->getProfile() : null;
/* Title of the JSON document */
$this->title = $title;
function addItemFromNotice($notice)
{
- $cur = empty($this->cur) ? common_current_user() : $this->cur;
-
- $act = $notice->asActivity($cur);
- $act->extra[] = $notice->noticeInfo($cur);
+ $act = $notice->asActivity($this->scoped);
+ $act->extra[] = $notice->noticeInfo($this->scoped);
array_push($this->items, $act->asArray());
$this->count++;
}
*/
function asString()
{
- $this->doc['generator'] = 'StatusNet ' . STATUSNET_VERSION; // extension
+ $this->doc['generator'] = 'GNU social ' . GNUSOCIAL_VERSION; // extension
$this->doc['title'] = $this->title;
$this->doc['url'] = $this->url;
$this->doc['totalItems'] = $this->count;
{
parent::__construct($url, $rel, $mediaType);
$this->linkDict = array(
- 'width' => $width,
- 'height' => $height,
- 'duration' => $duration
+ 'width' => intval($width),
+ 'height' => intval($height),
+ 'duration' => intval($duration)
);
}