forked from GNUsocial/gnu-social
Twitter lists compatible people tags api
This commit is contained in:
@@ -64,6 +64,7 @@ class ActivityObject
|
||||
const BOOKMARK = 'http://activitystrea.ms/schema/1.0/bookmark';
|
||||
const PERSON = 'http://activitystrea.ms/schema/1.0/person';
|
||||
const GROUP = 'http://activitystrea.ms/schema/1.0/group';
|
||||
const _LIST = 'http://activitystrea.ms/schema/1.0/list'; // LIST is reserved
|
||||
const PLACE = 'http://activitystrea.ms/schema/1.0/place';
|
||||
const COMMENT = 'http://activitystrea.ms/schema/1.0/comment';
|
||||
// ^^^^^^^^^^ tea!
|
||||
@@ -92,6 +93,7 @@ class ActivityObject
|
||||
public $title;
|
||||
public $summary;
|
||||
public $content;
|
||||
public $owner;
|
||||
public $link;
|
||||
public $source;
|
||||
public $avatarLinks = array();
|
||||
@@ -168,6 +170,10 @@ class ActivityObject
|
||||
Activity::MEDIA
|
||||
);
|
||||
}
|
||||
if ($this->type == self::_LIST) {
|
||||
$owner = ActivityUtils::child($this->element, Activity::AUTHOR, Activity::SPEC);
|
||||
$this->owner = new ActivityObject($owner);
|
||||
}
|
||||
}
|
||||
|
||||
private function _fromAuthor($element)
|
||||
@@ -520,13 +526,29 @@ class ActivityObject
|
||||
AVATAR_MINI_SIZE);
|
||||
|
||||
$object->poco = PoCo::fromGroup($group);
|
||||
|
||||
Event::handle('EndActivityObjectFromGroup', array($group, &$object));
|
||||
Event::handle('EndActivityObjectFromGroup', array($group, &$object));
|
||||
}
|
||||
|
||||
return $object;
|
||||
}
|
||||
|
||||
static function fromPeopletag($ptag)
|
||||
{
|
||||
$object = new ActivityObject();
|
||||
if (Event::handle('StartActivityObjectFromPeopletag', array($ptag, &$object))) {
|
||||
$object->type = ActivityObject::_LIST;
|
||||
|
||||
$object->id = $ptag->getUri();
|
||||
$object->title = $ptag->tag;
|
||||
$object->summary = $ptag->description;
|
||||
$object->link = $ptag->homeUrl();
|
||||
$object->owner = Profile::staticGet('id', $ptag->tagger);
|
||||
$object->poco = PoCo::fromProfile($object->owner);
|
||||
Event::handle('EndActivityObjectFromPeopletag', array($ptag, &$object));
|
||||
}
|
||||
return $object;
|
||||
}
|
||||
|
||||
function outputTo($xo, $tag='activity:object')
|
||||
{
|
||||
if (!empty($tag)) {
|
||||
@@ -601,6 +623,11 @@ class ActivityObject
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($this->owner)) {
|
||||
$owner = $this->owner->asActivityNoun(self::AUTHOR);
|
||||
$xo->raw($owner);
|
||||
}
|
||||
|
||||
if (!empty($this->geopoint)) {
|
||||
$xo->element(
|
||||
'georss:point',
|
||||
|
Reference in New Issue
Block a user