aboutsummaryrefslogtreecommitdiffstats
path: root/include/zot.php
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2018-03-27 21:11:34 -0400
committerAndrew Manning <tamanning@zoho.com>2018-03-27 21:11:34 -0400
commit1dc795722a8e748ebb98e8fab778cd4686a0654f (patch)
tree4f4a4e8dea10090106c4d54a02c6860332cd9df4 /include/zot.php
parentdcd658f12ea60945678717e3c310e94ece7b1f96 (diff)
parentc98776923a3aed4a0a17ca1412787de3b718eba9 (diff)
downloadvolse-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.php26
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'])