mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 00:55:19 +00:00
minor optimisation
This commit is contained in:
parent
5fc2dd2bca
commit
c22bc2075f
2 changed files with 5 additions and 4 deletions
|
@ -3684,7 +3684,7 @@ class Activity
|
|||
|
||||
$allowed = false;
|
||||
$reason = ['init'];
|
||||
|
||||
$isMail = (bool) (intval($item['item_private']) === 2);
|
||||
if ($is_child_node) {
|
||||
$parent_item = q(
|
||||
"select * from item where mid = '%s' and uid = %d",
|
||||
|
@ -3779,7 +3779,7 @@ class Activity
|
|||
}
|
||||
}
|
||||
else {
|
||||
if (perm_is_allowed($channel['channel_id'], $observer_hash, 'send_stream') || ($is_system && $pubstream)) {
|
||||
if ((!$isMail) && (perm_is_allowed($channel['channel_id'], $observer_hash, 'send_stream') || ($is_system && $pubstream))) {
|
||||
logger('allowed: permission allowed', LOGGER_DATA);
|
||||
$allowed = true;
|
||||
}
|
||||
|
@ -3801,7 +3801,7 @@ class Activity
|
|||
}
|
||||
}
|
||||
|
||||
if (intval($item['item_private']) === 2) {
|
||||
if ($isMail) {
|
||||
if (!perm_is_allowed($channel['channel_id'], $observer_hash, 'post_mail')) {
|
||||
$allowed = false;
|
||||
}
|
||||
|
|
|
@ -1771,6 +1771,7 @@ class Libzot
|
|||
}
|
||||
|
||||
$friendofriend = false;
|
||||
$isMail = (bool) (intval($arr['item_private']) === 2);
|
||||
|
||||
if ((!$tag_delivery) && (!$local_public)) {
|
||||
$allowed = (perm_is_allowed($channel['channel_id'], $sender, $perm));
|
||||
|
@ -1833,7 +1834,7 @@ class Libzot
|
|||
$friendofriend = true;
|
||||
}
|
||||
|
||||
if (intval($arr['item_private']) === 2) {
|
||||
if ($isMail) {
|
||||
if (!perm_is_allowed($channel['channel_id'], $sender, 'post_mail')) {
|
||||
$allowed = false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue