aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-06-23 09:13:51 +0000
committerMario <mario@mariovavti.com>2023-06-23 09:13:51 +0000
commitcd26ead043f9cb92ca4d59e587480520cb51f117 (patch)
tree6ffd776a1fa31f6dfb8462bd71c6a0b62157d3b2 /include/items.php
parent6a560cfec4628ac5c727578c1360f84c569ee6b7 (diff)
downloadvolse-hubzilla-cd26ead043f9cb92ca4d59e587480520cb51f117.tar.gz
volse-hubzilla-cd26ead043f9cb92ca4d59e587480520cb51f117.tar.bz2
volse-hubzilla-cd26ead043f9cb92ca4d59e587480520cb51f117.zip
implement optional moderation of unsolicited comments, minor css fixes and some more work on ocap
Diffstat (limited to 'include/items.php')
-rw-r--r--include/items.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/include/items.php b/include/items.php
index a74fe8b50..c6aeaa0ed 100644
--- a/include/items.php
+++ b/include/items.php
@@ -242,9 +242,21 @@ function comments_are_now_closed($item) {
}
function item_normal() {
- return " and item.item_hidden = 0 and item.item_type = 0 and item.item_deleted = 0
- and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_pending_remove = 0
- and item.item_blocked = 0 ";
+ $profile_uid = App::$profile['profile_uid'] ?? App::$profile_uid ?? null;
+ $uid = local_channel();
+ $is_owner = ($uid && intval($profile_uid) === $uid);
+
+ $sql = " and item.item_hidden = 0 and item.item_type = 0 and item.item_deleted = 0
+ and item.item_unpublished = 0 and item.item_pending_remove = 0";
+
+ if ($is_owner) {
+ $sql .= " and item.item_blocked IN (0, " . intval(ITEM_MODERATED) . ") and item.item_delayed IN (0, 1) ";
+ }
+ else {
+ $sql .= " and item.item_blocked = 0 and item.item_delayed = 0 ";
+ }
+
+ return $sql;
}
function item_normal_search() {