Commit 9a40a76c authored by Mario's avatar Mario

Merge branch 'dev' into 'dev'

further improve AP addressing to make pleroma happy and fix typos in startpage addon

See merge request hubzilla/addons!159
parents d7ab2fe3 2dbc9e0f
......@@ -445,7 +445,8 @@ function asencode_activity($i) {
$ret['to'] = [ $reply_url ];
}
else {
$ret['to'] = as_map_acl($i);
$ret['to'] = []; //this is important for pleroma
$ret['cc'] = as_map_acl($i);
}
}
else {
......@@ -467,19 +468,19 @@ function asencode_activity($i) {
$ret['to'][] = ACTIVITY_PUBLIC_INBOX;
$ret['cc'][] = $followers_url;
}
}
$mentions = as_map_mentions($i);
if(count($mentions)) {
$ret['cc'] = array_merge($ret['cc'], $mentions);
}
$mentions = as_map_mentions($i);
if(count($mentions)) {
$ret['to'] = (($ret['to']) ? array_merge($ret['to'],$mentions) : $mentions);
}
if(in_array($ret['object']['type'], [ 'Note', 'Article' ])) {
if($ret['to'])
if(isset($ret['to']))
$ret['object']['to'] = $ret['to'];
if($ret['cc'])
if(isset($ret['cc']))
$ret['object']['cc'] = $ret['cc'];
if($ret['tag'])
if(isset($ret['tag']))
$ret['object']['tag'] = $ret['tag'];
}
......
......@@ -14,13 +14,13 @@ use Zotlabs\Extend\Route;
function startpage_load() {
Hook::register('home_init', 'addon/startpage/startpage.php', 'startpage_home_init');
Route::register('addon/nsfw/Mod_Startpage.php','startpage');
Route::register('addon/startpage/Mod_Startpage.php','startpage');
}
function startpage_unload() {
Hook::unregister('home_init', 'addon/startpage/startpage.php', 'startpage_home_init');
Route::register('addon/startpage/Mod_Startpage.php','startpage');
Route::unregister('addon/startpage/Mod_Startpage.php','startpage');
}
function startpage_home_init(&$b) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment