diff options
author | Mario <mario@mariovavti.com> | 2024-02-13 10:48:06 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-02-13 10:48:06 +0000 |
commit | 9291622885646ce9c5ebb4249d90f86f8b74205d (patch) | |
tree | 4a89b05c2f351a5af649eb3f6f551d30e35c9559 /Zotlabs/Lib/Activity.php | |
parent | 07978a061eeeea0e95a381dab821bbd7f43e85ea (diff) | |
download | volse-hubzilla-9291622885646ce9c5ebb4249d90f86f8b74205d.tar.gz volse-hubzilla-9291622885646ce9c5ebb4249d90f86f8b74205d.tar.bz2 volse-hubzilla-9291622885646ce9c5ebb4249d90f86f8b74205d.zip |
fix logic so that direct messages will be allowed in case the send_mail permission is granted even if the send_stream permission is not granted
Diffstat (limited to 'Zotlabs/Lib/Activity.php')
-rw-r--r-- | Zotlabs/Lib/Activity.php | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index dc934c44c..020a87ea7 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -2712,6 +2712,17 @@ class Activity { $item['owner_xchan'] = $observer_hash; } + // An ugly and imperfect way to recognise a mastodon direct message + if ( + $item['item_private'] === 1 && + !isset($act->raw_recips['cc']) && + is_array($act->raw_recips['to']) && + in_array(channel_url($channel), $act->raw_recips['to']) && + !in_array($act->actor['followers'], $act->raw_recips['to']) + ) { + $item['item_private'] = 2; + } + $allowed = false; $permit_mentions = intval(PConfig::Get($channel['channel_id'], 'system','permit_all_mentions') && i_am_mentioned($channel, $item)); @@ -2830,8 +2841,8 @@ class Activity { } if (intval($item['item_private']) === 2) { - if (!perm_is_allowed($channel['channel_id'], $observer_hash, 'post_mail')) { - $allowed = false; + if (perm_is_allowed($channel['channel_id'], $observer_hash, 'post_mail')) { + $allowed = true; } } @@ -2978,17 +2989,6 @@ class Activity { } } - // An ugly and imperfect way to recognise a mastodon direct message - if ( - $item['item_private'] === 1 && - !isset($act->raw_recips['cc']) && - is_array($act->raw_recips['to']) && - in_array(channel_url($channel), $act->raw_recips['to']) && - !in_array($act->actor['followers'], $act->raw_recips['to']) - ) { - $item['item_private'] = 2; - } - // TODO: not implemented // self::rewrite_mentions($item); $r = q("select id, created, edited from item where mid = '%s' and uid = %d limit 1", |