diff options
author | Andrew Manning <tamanning@zoho.com> | 2018-03-27 21:11:34 -0400 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2018-03-27 21:11:34 -0400 |
commit | 1dc795722a8e748ebb98e8fab778cd4686a0654f (patch) | |
tree | 4f4a4e8dea10090106c4d54a02c6860332cd9df4 /include/zot.php | |
parent | dcd658f12ea60945678717e3c310e94ece7b1f96 (diff) | |
parent | c98776923a3aed4a0a17ca1412787de3b718eba9 (diff) | |
download | volse-hubzilla-1dc795722a8e748ebb98e8fab778cd4686a0654f.tar.gz volse-hubzilla-1dc795722a8e748ebb98e8fab778cd4686a0654f.tar.bz2 volse-hubzilla-1dc795722a8e748ebb98e8fab778cd4686a0654f.zip |
Merge branch 'dev' into oauth2
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']) |