mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 16:55:18 +00:00
Merge branch 'dev' into nomadic
This commit is contained in:
commit
2118b2aeaf
2 changed files with 9 additions and 2 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue