diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-03-23 10:03:54 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-03-23 10:03:54 +0100 |
commit | 376091010f0c4613c76e30d81285c5c5f54f56d5 (patch) | |
tree | 6a61747e2ba53c507488d87e33bda6eba7ab84ef /include/zot.php | |
parent | ac967db4e87761c1be98d6f548ecedd55d942fea (diff) | |
parent | af8cbf000fb1433b7c7d2c6c4543980f01ba69a9 (diff) | |
download | volse-hubzilla-376091010f0c4613c76e30d81285c5c5f54f56d5.tar.gz volse-hubzilla-376091010f0c4613c76e30d81285c5c5f54f56d5.tar.bz2 volse-hubzilla-376091010f0c4613c76e30d81285c5c5f54f56d5.zip |
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'include/zot.php')
-rw-r--r-- | include/zot.php | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/include/zot.php b/include/zot.php index c11cace2a..25ea9b8fb 100644 --- a/include/zot.php +++ b/include/zot.php @@ -2285,13 +2285,31 @@ function process_mail_delivery($sender, $arr, $deliveries) { continue; } + if(! perm_is_allowed($channel['channel_id'],$sender['hash'],'post_mail')) { - logger("permission denied for mail delivery {$channel['channel_id']}"); - $DR->update('permission denied'); - $result[] = $DR->get(); - continue; + + /* + * Always allow somebody to reply if you initiated the conversation. It's anti-social + * and a bit rude to send a private message to somebody and block their ability to respond. + * If you are being harrassed and want to put an end to it, delete the conversation. + */ + + $return = false; + if($arr['parent_mid']) { + $return = q("select * from mail where mid = '%s' and channel_id = %d limit 1", + dbesc($arr['parent_mid']), + intval($channel['channel_id']) + ); + } + if(! $return) { + logger("permission denied for mail delivery {$channel['channel_id']}"); + $DR->update('permission denied'); + $result[] = $DR->get(); + continue; + } } + $r = q("select id from mail where mid = '%s' and channel_id = %d limit 1", dbesc($arr['mid']), intval($channel['channel_id']) |