Merge branch 'dev' into release

This commit is contained in:
Mike Macgirvin 2022-05-12 14:15:49 -07:00
commit ddad07cb86
4 changed files with 30 additions and 5 deletions

View file

@ -176,6 +176,7 @@ function import_config($channel, $configs)
}
set_pconfig($channel['channel_id'], $config['cat'], $config['k'], $config['v']);
}
set_pconfig($channel['channel_id'], 'perm_limits', 'deliver_stream', PERMS_SPECIFIC);
load_pconfig($channel['channel_id']);
$permissions_role = get_pconfig($channel['channel_id'], 'system', 'permissions_role');

View file

@ -161,11 +161,11 @@ function collect_recipients($item, &$private_envelope,$include_groups = true) {
// This is a somewhat expensive operation but important.
// Don't send this item to anybody who doesn't have the deliver_stream permission
logger('recip1: ' . print_r($recipients,true));
$recipients = check_deliver_permissions($item['uid'],$recipients);
logger('recip2: ' . print_r($recipients,true));
$recipients = check_list_permissions($item['uid'],$recipients,'deliver_stream');
// add ourself just in case we have nomadic clones that need to get a copy.
// Add both the author and owner (if different).
$recipients[] = $item['author_xchan'];

View file

@ -532,6 +532,30 @@ function check_list_permissions($uid, $arr, $perm)
return($result);
}
function check_deliver_permissions($uid, $arr)
{
$result = [];
// Find actors we are not delivering to.
$r = q("select * from abconfig where uid = %d and cat = 'system' and k = 'my_perms' and v not like '%%deliver_stream%%'",
intval($uid)
);
$disallowed = ids_to_array($r,'xchan');
// Filter the recipient list accordingly.
if ($arr) {
foreach ($arr as $x) {
if (! in_array($x, $disallowed)) {
$result[] = $x;
}
}
}
return($result);
}
/**
* @brief Sets site wide default permissions.
*

View file

@ -1,2 +1,2 @@
<?php
define ( 'STD_VERSION', '22.05.12' );
define ( 'STD_VERSION', '22.05.13' );