aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-06-29 11:29:48 +0000
committerMario <mario@mariovavti.com>2023-06-29 11:29:48 +0000
commitc2952aa803cc7c7c03786b285e9f2b1f24b98c72 (patch)
tree1810d4fca278ef7bc080d062e426c6fb2801349d
parent8f7383f5c24bf1bdb4967ec11764554dd881050a (diff)
downloadvolse-hubzilla-c2952aa803cc7c7c03786b285e9f2b1f24b98c72.tar.gz
volse-hubzilla-c2952aa803cc7c7c03786b285e9f2b1f24b98c72.tar.bz2
volse-hubzilla-c2952aa803cc7c7c03786b285e9f2b1f24b98c72.zip
make sure to not allow moderation of poll answers
-rw-r--r--Zotlabs/Lib/Activity.php20
1 files changed, 12 insertions, 8 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 48c99a0de..4a89842f2 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -2170,6 +2170,10 @@ class Activity {
return false;
}
+ if (intval($post['item_blocked']) === ITEM_MODERATED) {
+ return false;
+ }
+
dbq("START TRANSACTION");
$item = q("SELECT * FROM item WHERE id = %d FOR UPDATE",
@@ -2945,6 +2949,12 @@ class Activity {
// TODO: if we do not have a parent stop here and move the fetch to background?
+ if ($parent && $parent[0]['obj_type'] === 'Question') {
+ if ($item['obj_type'] === ACTIVITY_OBJ_COMMENT && $item['title'] && (!$item['body'])) {
+ $item['obj_type'] = 'Answer';
+ }
+ }
+
if ($parent && $parent[0]['item_wall']) {
// set the owner to the owner of the parent
$item['owner_xchan'] = $parent[0]['owner_xchan'];
@@ -2977,8 +2987,8 @@ class Activity {
}*/
if (!$allowed) {
- if (get_pconfig($channel['channel_id'], 'system', 'moderate_unsolicited_comments')) {
- $item['item_blocked'] = intval(ITEM_MODERATED);
+ if (get_pconfig($channel['channel_id'], 'system', 'moderate_unsolicited_comments') && $item['obj_type'] !== 'Answer') {
+ $item['item_blocked'] = ITEM_MODERATED;
$allowed = true;
}
else {
@@ -3006,12 +3016,6 @@ class Activity {
$allowed = false;
}
}
-
- if ($parent && $parent[0]['obj_type'] === 'Question') {
- if ($item['obj_type'] === ACTIVITY_OBJ_COMMENT && $item['title'] && (!$item['body'])) {
- $item['obj_type'] = 'Answer';
- }
- }
}
else {