'and post again in a few minutes.'));
}
-/* This interferes with stuff like Favorites from old StatusNet installations (first object in objects is the favored notice)
// Get ActivityObject properties
- $actobj = count($act->objects)==1 ? $act->objects[0] : null;
- if (!is_null($actobj) && $actobj->id) {
- $options['uri'] = $actobj->id;
- if ($actobj->link) {
- $options['url'] = $actobj->link;
- } elseif ($act->link) {
- $options['url'] = $act->link;
- } elseif (preg_match('!^https?://!', $actobj->id)) {
- $options['url'] = $actobj->id;
- }
- } else {
+ if (!empty($act->id)) {
// implied object
$options['uri'] = $act->id;
$options['url'] = $act->link;
+ } else {
+ $actobj = count($act->objects)==1 ? $act->objects[0] : null;
+ if (!is_null($actobj) && !empty($actobj->id)) {
+ $options['uri'] = $actobj->id;
+ if ($actobj->link) {
+ $options['url'] = $actobj->link;
+ } elseif (preg_match('!^https?://!', $actobj->id)) {
+ $options['url'] = $actobj->id;
+ }
+ }
}
-*/
$defaults = array(
'groups' => array(),
if (!empty($targetEl)) {
$this->target = new ActivityObject($targetEl);
+ } elseif (ActivityUtils::compareTypes($this->verb, array(ActivityVerb::FAVORITE))) {
+ // StatusNet didn't send a 'target' for their Favorite atom entries
+ $this->target = clone($this->objects[0]);
}
$this->summary = ActivityUtils::childContent($entry, 'summary');
if (!isset($options['created'])) {
$options['created'] = !empty($act->time) ? common_sql_date($act->time) : common_sql_now();
}
- if (!isset($options['uri'])) {
- $options['uri'] = !empty($act->id) ? $act->id : $act->selfLink;
- }
// We must have an objects[0] here because in isMyActivity we require the count to be == 1
$actobj = $act->objects[0];