aboutsummaryrefslogtreecommitdiffstats
path: root/include/feedutils.php
diff options
context:
space:
mode:
authorgit-marijus <mario@mariovavti.com>2017-07-18 14:26:08 +0200
committergit-marijus <mario@mariovavti.com>2017-07-18 14:26:08 +0200
commitac6ebeee473e2e4b0536b0884a9251e32ea5bcff (patch)
treead3428838a67dfa080f9f4f251aaa9bf309c564c /include/feedutils.php
parent08c0d78296d4518a5ece4d6a2c05b9be83580aa8 (diff)
parent15e836b7dd2fed3f97f134928d88e13db1d8a7f4 (diff)
downloadvolse-hubzilla-ac6ebeee473e2e4b0536b0884a9251e32ea5bcff.tar.gz
volse-hubzilla-ac6ebeee473e2e4b0536b0884a9251e32ea5bcff.tar.bz2
volse-hubzilla-ac6ebeee473e2e4b0536b0884a9251e32ea5bcff.zip
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'include/feedutils.php')
-rw-r--r--include/feedutils.php37
1 files changed, 25 insertions, 12 deletions
diff --git a/include/feedutils.php b/include/feedutils.php
index 6ee53e2f6..5f2a06029 100644
--- a/include/feedutils.php
+++ b/include/feedutils.php
@@ -1040,6 +1040,11 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) {
$datarray['comment_policy'] = 'none';
}
+ // if we have everything but a photo, provide the default profile photo
+
+ if($author['author_name'] && $author['author_link'] && (! $author['author_photo']))
+ $author['author_photo'] = z_root() . '/' . get_default_profile_photo(80);
+
if((! x($author,'author_name')) || ($author['author_is_feed']))
$author['author_name'] = $contact['xchan_name'];
if((! x($author,'author_link')) || ($author['author_is_feed']))
@@ -1244,6 +1249,12 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) {
$datarray['comment_policy'] = 'none';
}
+
+ // if we have everything but a photo, provide the default profile photo
+
+ if($author['author_name'] && $author['author_link'] && (! $author['author_photo']))
+ $author['author_photo'] = z_root() . '/' . get_default_profile_photo(80);
+
if(is_array($contact)) {
if((! x($author,'author_name')) || ($author['author_is_feed']))
$author['author_name'] = $contact['xchan_name'];
@@ -1879,17 +1890,17 @@ function i2asld($i) {
$ret = array();
- $ret['@context'] = array( 'http://www.w3.org/ns/activitystreams', 'zot' => 'http://purl.org/zot/protocol');
+ $ret['@context'] = array( 'https://www.w3.org/ns/activitystreams', 'zot' => 'http://purl.org/zot/protocol');
if($i['verb']) {
if(strpos(dirname($i['verb'],'activitystrea.ms/schema/1.0'))) {
- $ret['@type'] = ucfirst(basename($i['verb']));
+ $ret['type'] = ucfirst(basename($i['verb']));
}
elseif(strpos(dirname($i['verb'],'purl.org/zot'))) {
- $ret['@type'] = 'zot:' . ucfirst(basename($i['verb']));
+ $ret['type'] = 'zot:' . ucfirst(basename($i['verb']));
}
}
- $ret['@id'] = $i['plink'];
+ $ret['id'] = $i['plink'];
$ret['published'] = datetime_convert('UTC','UTC',$i['created'],ATOM_TIME);
@@ -1911,7 +1922,7 @@ function asencode_note($i) {
$ret = array();
$ret['@type'] = 'Note';
- $ret['@id'] = $i['plink'];
+ $ret['id'] = $i['plink'];
if($i['title'])
$ret['title'] = bbcode($i['title']);
@@ -1927,16 +1938,18 @@ function asencode_note($i) {
function asencode_person($p) {
$ret = array();
- $ret['@type'] = 'Person';
- $ret['@id'] = 'acct:' . $p['xchan_addr'];
- $ret['displayName'] = $p['xchan_name'];
- $ret['icon'] = array(
- '@type' => 'Link',
+ $ret['type'] = 'Person';
+ $ret['id'] = $p['xchan_url'];
+ $ret['name'] = $p['xchan_name'];
+ $ret['image'] = array(
+ 'type' => 'Link',
'mediaType' => $p['xchan_photo_mimetype'],
- 'href' => $p['xchan_photo_m']
+ 'href' => $p['xchan_photo_l'],
+ 'height' => 300,
+ 'width' => 300
);
$ret['url'] = array(
- '@type' => 'Link',
+ 'type' => 'Link',
'mediaType' => 'text/html',
'href' => $p['xchan_url']
);