diff options
author | Mario <mario@mariovavti.com> | 2023-06-29 11:29:48 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2023-06-29 11:29:48 +0000 |
commit | c2952aa803cc7c7c03786b285e9f2b1f24b98c72 (patch) | |
tree | 1810d4fca278ef7bc080d062e426c6fb2801349d /Zotlabs/Lib | |
parent | 8f7383f5c24bf1bdb4967ec11764554dd881050a (diff) | |
download | volse-hubzilla-c2952aa803cc7c7c03786b285e9f2b1f24b98c72.tar.gz volse-hubzilla-c2952aa803cc7c7c03786b285e9f2b1f24b98c72.tar.bz2 volse-hubzilla-c2952aa803cc7c7c03786b285e9f2b1f24b98c72.zip |
make sure to not allow moderation of poll answers
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r-- | Zotlabs/Lib/Activity.php | 20 |
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 { |