aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/items.php10
-rw-r--r--view/js/main.js10
2 files changed, 16 insertions, 4 deletions
diff --git a/include/items.php b/include/items.php
index e043987c9..7c19759da 100644
--- a/include/items.php
+++ b/include/items.php
@@ -5462,8 +5462,14 @@ function items_by_parent_ids($ids, $thr_parents = '', $blog_mode = false) {
}
function items_by_thr_parent($mid, $parent, $sql_extra = '') {
- $item_normal = item_normal();
- $item_normal_c = item_normal(prefix: 'c');
+ $parent_item = q("SELECT uid FROM item WHERE id = %d",
+ intval($parent)
+ );
+
+ $owner_uid = $parent_item[0]['uid'];
+
+ $item_normal = item_normal($owner_uid);
+ $item_normal_c = item_normal($owner_uid, 'c');
$activity_sql = item_activity_sql('c');
if (local_channel()) {
diff --git a/view/js/main.js b/view/js/main.js
index 75c26dc29..f8c0ce802 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -26,6 +26,8 @@ var followUpPageLoad = false;
var window_needs_alert = true;
var expanded_items = [];
var updateTimeout = [];
+const singlethread_modules = ['display', 'hq'];
+const redirect_modules = ['display', 'notify'];
var page_cache = {};
@@ -149,8 +151,6 @@ $(document).ready(function() {
let notify_id = this.dataset.notify_id;
let path = $(this)[0].pathname.split('/')[1];
let stateObj = { b64mid: b64mid };
- let singlethread_modules = ['display', 'hq'];
- let redirect_modules = ['display', 'notify'];
if (!b64mid && !notify_id) {
return;
@@ -1288,6 +1288,12 @@ function request(id, mid, verb, parent, uuid) {
loading.style.display = 'block';
if (verb === 'comment') {
+
+ if (singlethread_modules.indexOf(module) !== -1) {
+ let stateObj = { uuid: uuid };
+ history.pushState(stateObj, '', module + '/' + uuid);
+ }
+
document.querySelectorAll('.thread-wrapper.item-highlight').forEach(el => {
el.classList.remove('item-highlight');
});