diff --git a/include/permissions.php b/include/permissions.php index 8991cb6bb..e6a706788 100644 --- a/include/permissions.php +++ b/include/permissions.php @@ -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%%'", 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. if ($arr) { foreach ($arr as $x) { - if (! in_array($x, $disallowed)) { + if (in_array($x, $theyAccept) && ! in_array($x, $willNotSend)) { $result[] = $x; } } diff --git a/src/Daemon/Notifier.php b/src/Daemon/Notifier.php index 1e86b19d4..5da368ba1 100644 --- a/src/Daemon/Notifier.php +++ b/src/Daemon/Notifier.php @@ -500,6 +500,7 @@ class Notifier implements DaemonInterface foreach ($r as $rv) { self::$recipients[] = $rv['abook_xchan']; } + self::$recipients = check_deliver_permissions($target_item['uid'], self::$recipients); } } else {