Fixes some non-defined variables in commit eb2f93a
This commit is contained in:
parent
483b2d3d29
commit
89704bcdee
@ -54,6 +54,7 @@ class ActivityStreamJSONDocument extends JSONActivityCollection
|
|||||||
|
|
||||||
/* The current authenticated user */
|
/* The current authenticated user */
|
||||||
protected $cur;
|
protected $cur;
|
||||||
|
protected $scoped = null;
|
||||||
|
|
||||||
/* Title of the document */
|
/* Title of the document */
|
||||||
protected $title;
|
protected $title;
|
||||||
@ -75,7 +76,8 @@ class ActivityStreamJSONDocument extends JSONActivityCollection
|
|||||||
{
|
{
|
||||||
parent::__construct($items, $url);
|
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 */
|
/* Title of the JSON document */
|
||||||
$this->title = $title;
|
$this->title = $title;
|
||||||
@ -138,10 +140,8 @@ class ActivityStreamJSONDocument extends JSONActivityCollection
|
|||||||
|
|
||||||
function addItemFromNotice($notice)
|
function addItemFromNotice($notice)
|
||||||
{
|
{
|
||||||
$cur = empty($this->cur) ? common_current_user() : $this->cur;
|
$act = $notice->asActivity($this->scoped);
|
||||||
|
$act->extra[] = $notice->noticeInfo($this->scoped);
|
||||||
$act = $notice->asActivity($cur);
|
|
||||||
$act->extra[] = $notice->noticeInfo($cur->getProfile());
|
|
||||||
array_push($this->items, $act->asArray());
|
array_push($this->items, $act->asArray());
|
||||||
$this->count++;
|
$this->count++;
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,7 @@ if (!defined('STATUSNET'))
|
|||||||
class AtomNoticeFeed extends Atom10Feed
|
class AtomNoticeFeed extends Atom10Feed
|
||||||
{
|
{
|
||||||
var $cur;
|
var $cur;
|
||||||
|
protected $scoped=null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor - adds a bunch of XML namespaces we need in our
|
* Constructor - adds a bunch of XML namespaces we need in our
|
||||||
@ -58,7 +59,8 @@ class AtomNoticeFeed extends Atom10Feed
|
|||||||
function __construct($cur = null, $indent = true) {
|
function __construct($cur = null, $indent = true) {
|
||||||
parent::__construct($indent);
|
parent::__construct($indent);
|
||||||
|
|
||||||
$this->cur = $cur;
|
$this->cur = $cur ?: common_current_user();
|
||||||
|
$this->scoped = !is_null($this->cur) ? $this->cur->getProfile() : null;
|
||||||
|
|
||||||
// Feeds containing notice info use these namespaces
|
// Feeds containing notice info use these namespaces
|
||||||
|
|
||||||
@ -129,9 +131,7 @@ class AtomNoticeFeed extends Atom10Feed
|
|||||||
$source = $this->showSource();
|
$source = $this->showSource();
|
||||||
$author = $this->showAuthor();
|
$author = $this->showAuthor();
|
||||||
|
|
||||||
$cur = empty($this->cur) ? common_current_user() : $this->cur;
|
$this->addEntryRaw($notice->asAtomEntry(false, $source, $author, $this->scoped));
|
||||||
|
|
||||||
$this->addEntryRaw($notice->asAtomEntry(false, $source, $author, $cur));
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
common_log(LOG_ERR, $e->getMessage());
|
common_log(LOG_ERR, $e->getMessage());
|
||||||
// we continue on exceptions
|
// we continue on exceptions
|
||||||
|
@ -64,10 +64,7 @@ class AtomUserNoticeFeed extends AtomNoticeFeed
|
|||||||
|
|
||||||
$ao = $profile->asActivityObject();
|
$ao = $profile->asActivityObject();
|
||||||
|
|
||||||
// quick fix until we start using Profile everywhere instead of User
|
array_push($ao->extra, $profile->profileInfo($this->scoped));
|
||||||
$scoped = !is_null($cur) ? $cur->getProfile() : null;
|
|
||||||
|
|
||||||
array_push($ao->extra, $profile->profileInfo($scoped));
|
|
||||||
|
|
||||||
$this->addAuthorRaw($ao->asString('author'));
|
$this->addAuthorRaw($ao->asString('author'));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user