mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-21 00:52:33 -04:00
some work on improving federation of item_private and make sure we deal with an array in array_path_exists()
This commit is contained in:
@@ -2339,8 +2339,13 @@ class Activity {
|
||||
$s['plink'] = $s['mid'];
|
||||
}
|
||||
|
||||
if ($act->recips && (! in_array(ACTIVITY_PUBLIC_INBOX,$act->recips)))
|
||||
$s['item_private'] = 1;
|
||||
// assume this is private unless specifically told otherwise.
|
||||
|
||||
$s['item_private'] = 1;
|
||||
|
||||
if ($act->recips && in_array(ACTIVITY_PUBLIC_INBOX, $act->recips)) {
|
||||
$s['item_private'] = 0;
|
||||
}
|
||||
|
||||
if (is_array($act->obj)) {
|
||||
if (array_key_exists('directMessage',$act->obj) && intval($act->obj['directMessage'])) {
|
||||
|
||||
@@ -146,15 +146,20 @@ class ActivityStreams {
|
||||
*/
|
||||
function collect_recips($base = '', $namespace = '') {
|
||||
$x = [];
|
||||
|
||||
$fields = [ 'to', 'cc', 'bto', 'bcc', 'audience'];
|
||||
foreach($fields as $f) {
|
||||
$y = $this->get_compound_property($f, $base, $namespace);
|
||||
if($y) {
|
||||
$x = array_merge($x, $y);
|
||||
if(! is_array($this->raw_recips))
|
||||
if (! is_array($this->raw_recips)) {
|
||||
$this->raw_recips = [];
|
||||
}
|
||||
|
||||
$this->raw_recips[$f] = $x;
|
||||
if (! is_array($y)) {
|
||||
$y = [ $y ];
|
||||
}
|
||||
$this->raw_recips[$f] = $y;
|
||||
$x = array_merge($x, $y);
|
||||
}
|
||||
}
|
||||
// not yet ready for prime time
|
||||
@@ -411,4 +416,4 @@ class ActivityStreams {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3732,7 +3732,7 @@ function array_path_exists($str,$arr) {
|
||||
|
||||
if($search) {
|
||||
foreach($search as $s) {
|
||||
if($ptr && array_key_exists($s,$ptr)) {
|
||||
if(is_array($ptr) && array_key_exists($s,$ptr)) {
|
||||
$ptr = $ptr[$s];
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user