diff options
-rw-r--r-- | boot.php | 2 | ||||
-rw-r--r-- | include/items.php | 14 | ||||
-rw-r--r-- | view/js/main.js | 8 |
3 files changed, 17 insertions, 7 deletions
@@ -69,7 +69,7 @@ require_once('include/security.php'); define('PLATFORM_NAME', 'hubzilla'); -define('STD_VERSION', '10.3.17+lazy'); +define('STD_VERSION', '10.3.18+lazy'); define('ZOT_REVISION', '6.0'); define('DB_UPDATE_VERSION', 1263); diff --git a/include/items.php b/include/items.php index 1dac18ec0..889047000 100644 --- a/include/items.php +++ b/include/items.php @@ -5521,14 +5521,19 @@ function items_by_thr_parent($mid, $parent, $sql_extra = '') { function item_activity_xchans($mid, $parent, $verb) { $observer_hash = get_observer_hash(); - $item_normal = item_normal(); - $parent_item = q("SELECT * FROM item WHERE id = %d", intval($parent) ); + $item_uid = $parent_item[0]['uid']; + + // Set App::$profile_uid before calling item_normal() + App::$profile_uid = $item_uid; + $item_normal = item_normal(); + + if (local_channel()) { - $ret = q("SELECT xchan.xchan_hash, xchan.xchan_name as name, xchan.xchan_url as url, xchan.xchan_photo_s as photo FROM item + $ret = q("SELECT item.id, item.item_blocked, xchan.xchan_hash, xchan.xchan_name as name, xchan.xchan_url as url, xchan.xchan_photo_s as photo FROM item LEFT JOIN xchan ON item.author_xchan = xchan.xchan_hash WHERE item.uid = %d AND item.parent = %d @@ -5545,10 +5550,9 @@ function item_activity_xchans($mid, $parent, $verb) { } if (!$ret) { - $item_uid = $parent_item[0]['uid']; $sql_extra = item_permissions_sql($item_uid, $observer_hash); - $ret = q("SELECT xchan.xchan_hash, xchan.xchan_name as name, xchan.xchan_url as url, xchan.xchan_photo_s as photo FROM item + $ret = q("SELECT item.id, item.item_blocked, xchan.xchan_hash, xchan.xchan_name as name, xchan.xchan_url as url, xchan.xchan_photo_s as photo FROM item LEFT JOIN xchan ON item.author_xchan = xchan.xchan_hash WHERE item.uid = %d AND item.thr_parent = '%s' diff --git a/view/js/main.js b/view/js/main.js index 73ee3ebb1..75c26dc29 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -1340,8 +1340,14 @@ function request(id, mid, verb, parent, uuid) { modal_action.innerHTML = '<a href="#" onclick="' + obj.action + '(' + id + ',\'' + verb + '\'); return false;">' + obj.action_label + '</a>'; modal_action.style.display = 'block'; } + console.log(obj) obj.result.forEach(e => { - modal_content.innerHTML += '<a href="' + e.url + '" class="list-group-item list-group-item-action border-0"><img src="' + e.photo + '" class="menu-img-1" loading="lazy"> ' + e.name + '</a>'; + let mod = ''; + if (e.item_blocked === 4) { + mod = '<span onclick="moderate_approve(' + e.id + '); return false;" class="text-success pe-4 d-inline-block"><i class="bi bi-check-lg" ></i></span><span onclick="moderate_drop(' + e.id + '); return false;" class="text-danger pe-4 d-inline-block"><i class="bi bi-trash" ></i></span>'; + } + modal_content.innerHTML += '<a href="' + e.url + '" class="list-group-item list-group-item-action border-0">' + mod + '<img src="' + e.photo + '" class="menu-img-1" loading="lazy"> ' + e.name + '</a>'; + }); modal.show(); |