nomadic and trheading updates

This commit is contained in:
zotlabs 2019-09-26 17:05:30 -07:00
parent 87b1b8a869
commit 4d4af4f1b5
4 changed files with 40 additions and 14 deletions

View file

@ -978,7 +978,11 @@ class Activity {
}
if ($locations) {
$ret['zot:alsoKnownAs'] = $locations;
if (count($locations) === 1) {
$locations = array_shift($locations);
}
$ret['copiedTo'] = $locations;
$ret['alsoKnownAs'] = $locations;
}
$cp = get_cover_photo($c['channel_id'],'array');

View file

@ -941,22 +941,42 @@ class ThreadItem {
// present friend-of-friend conversations from hyperdrive as relayed posts from the first friend
// we find among the respondents.
if($this->is_toplevel() && (! $this->data['owner']['abook_id'])) {
$children = $this->data['children'];
if($children) {
foreach($children as $child) {
if($child['author']['abook_id'] && (! intval($child['author']['abook_self']))) {
$this->owner_url = chanlink_hash($child['author']['xchan_hash']);
$this->owner_photo = $child['author']['xchan_photo_m'];
$this->owner_name = $child['author']['xchan_name'];
$this->wall_to_wall = true;
break;
}
if ($this->is_toplevel() && (! $this->data['owner']['abook_id'])) {
if ($this->data['children']) {
$friend = $this->find_a_friend($this->data['children']);
if ($friend) {
$this->owner_url = $friend['url'];
$this->owner_photo = $friend['photo'];
$this->owner_name = $friend['name'];
$this->wall_to_wall = true;
}
}
}
}
private function find_a_friend($items) {
$ret = null;
if ($items) {
foreach ($items as $child) {
if ($child['author']['abook_id'] && (! intval($child['author']['abook_self']))) {
return [
'url' => chanlink_hash($child['author']['xchan_hash']),
'photo' => $child['author']['xchan_photo_m'],
'name' => $child['author']['xchan_name']
];
if ($child['children']) {
$ret = $this->find_a_friend($child['children']);
if ($ret) {
break;
}
}
}
}
}
return $ret;
}
private function is_wall_to_wall() {
return $this->wall_to_wall;
}

View file

@ -17,6 +17,9 @@ class Apschema extends \Zotlabs\Web\Controller {
'ostatus' => 'http://ostatus.org#',
'conversation' => 'ostatus:conversation',
'sensitive' => 'as:sensitive',
'movedTo' => 'as:movedTo',
'copiedTo' => 'as:copiedTo',
'alsoKnownAs' => 'as:alsoKnownAs',
'inheritPrivacy' => 'as:inheritPrivacy',
'commentPolicy' => 'zot:commentPolicy',
'topicalCollection' => 'zot:topicalCollection',
@ -24,7 +27,6 @@ class Apschema extends \Zotlabs\Web\Controller {
'emojiReaction' => 'zot:emojiReaction',
'expires' => 'zot:expires',
'directMessage' => 'zot:directMessage',
'alsoKnownAs' => 'zot:alsoKnownAs',
'replyTo' => 'zot:replyTo'
]
];

View file

@ -470,7 +470,7 @@ define ( 'NAMESPACE_YMEDIA', 'http://search.yahoo.com/mrss/' );
define ( 'ACTIVITYSTREAMS_JSONLD_REV', 'https://www.w3.org/ns/activitystreams' );
define ( 'ZOT_APSCHEMA_REV', '/apschema/v1.12' );
define ( 'ZOT_APSCHEMA_REV', '/apschema/v1.13' );
/**
* activity stream defines