Merge branch 'dev' into nomadic

This commit is contained in:
Mike Macgirvin 2024-05-12 10:04:02 +10:00
commit 2118b2aeaf
2 changed files with 9 additions and 2 deletions

View file

@ -522,12 +522,18 @@ function check_deliver_permissions($uid, $arr)
$r = q("select * from abconfig where chan = %d and cat = 'system' and k = 'my_perms' and v not like '%%deliver_stream%%'", $r = q("select * from abconfig where chan = %d and cat = 'system' and k = 'my_perms' and v not like '%%deliver_stream%%'",
intval($uid) intval($uid)
); );
$disallowed = ids_to_array($r,'xchan'); $willNotSend = ids_to_array($r,'xchan');
// Find actors accepting our posts
$r = q("select * from abconfig where chan = %d and cat = 'system' and k = 'their_perms' and v like '%%send_stream%%'",
intval($uid)
);
$theyAccept = ids_to_array($r, 'xchan');
// Filter the recipient list accordingly. // Filter the recipient list accordingly.
if ($arr) { if ($arr) {
foreach ($arr as $x) { foreach ($arr as $x) {
if (! in_array($x, $disallowed)) { if (in_array($x, $theyAccept) && ! in_array($x, $willNotSend)) {
$result[] = $x; $result[] = $x;
} }
} }

View file

@ -500,6 +500,7 @@ class Notifier implements DaemonInterface
foreach ($r as $rv) { foreach ($r as $rv) {
self::$recipients[] = $rv['abook_xchan']; self::$recipients[] = $rv['abook_xchan'];
} }
self::$recipients = check_deliver_permissions($target_item['uid'], self::$recipients);
} }
} }
else { else {