From 8a3a77d2732589a963cc749bb9e14e71336716b7 Mon Sep 17 00:00:00 2001 From: Kibi Kelburton Date: Sun, 31 May 2026 18:24:22 +0200 Subject: [PATCH] gfds --- public/s/js/f0ckm.js | 35 +++++++++++++++++++++++------------ src/inc/routes/ajax.mjs | 2 ++ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/public/s/js/f0ckm.js b/public/s/js/f0ckm.js index 31d4773..c395cbb 100644 --- a/public/s/js/f0ckm.js +++ b/public/s/js/f0ckm.js @@ -6724,21 +6724,31 @@ class NotificationSystem { // Build filters from URL const url = window.location.pathname; let tag = null, user = null, mime = null, hall = null; - + let userHall = null, userHallOwner = null; + let isFav = false; + const tagMatch = url.match(/\/tag\/([^/?]+)/); if (tagMatch) tag = decodeURIComponent(tagMatch[1]); const hallMatch = url.match(/\/h\/([^/?]+)/); if (hallMatch) hall = decodeURIComponent(hallMatch[1]); - const userMatch = url.match(/\/user\/([^/]+)/); - if (userMatch && !url.match(/\/user\/[^/]+\/(favs|f0cks|comments)/)) user = decodeURIComponent(userMatch[1]); - const favMatch = url.match(/\/user\/([^/]+)\/favs/); - const f0cksMatch = url.match(/\/user\/([^/]+)\/f0cks/); - let isFav = false; - if (favMatch) { - user = decodeURIComponent(favMatch[1]); - isFav = true; - } else if (f0cksMatch) { - user = decodeURIComponent(f0cksMatch[1]); + + // Detect user-hall pages: /user//hall/ + // Must be checked BEFORE the generic user match so we don't pollute `user` + const userHallMatch = url.match(/\/user\/([^/]+)\/hall\/([^/?]+)/); + if (userHallMatch) { + userHallOwner = decodeURIComponent(userHallMatch[1]); + userHall = decodeURIComponent(userHallMatch[2]); + } else { + const userMatch = url.match(/\/user\/([^/]+)/); + if (userMatch && !url.match(/\/user\/[^/]+\/(favs|f0cks|comments|halls?)/)) user = decodeURIComponent(userMatch[1]); + const favMatch = url.match(/\/user\/([^/]+)\/favs/); + const f0cksMatch = url.match(/\/user\/([^/]+)\/f0cks/); + if (favMatch) { + user = decodeURIComponent(favMatch[1]); + isFav = true; + } else if (f0cksMatch) { + user = decodeURIComponent(f0cksMatch[1]); + } } const mimeMatch = url.match(/\/(image|audio|video)/); if (mimeMatch) mime = mimeMatch[1]; @@ -6746,10 +6756,11 @@ class NotificationSystem { let ajaxUrl = `/ajax/items/?newer=${maxId}&mode=${window.activeMode}`; if (tag) ajaxUrl += `&tag=${encodeURIComponent(tag)}`; if (hall) ajaxUrl += `&hall=${encodeURIComponent(hall)}`; + if (userHall) ajaxUrl += `&userHall=${encodeURIComponent(userHall)}&userHallOwner=${encodeURIComponent(userHallOwner)}`; if (user) ajaxUrl += `&user=${encodeURIComponent(user)}`; if (isFav) ajaxUrl += `&fav=true`; if (mime) ajaxUrl += `&mime=${encodeURIComponent(mime)}`; - + const isStrict = window.f0ckSession?.strict_mode || (localStorage.getItem('search_strict') === 'true') || window.location.search.includes('strict=1'); if (isStrict) ajaxUrl += `&strict=1`; ajaxUrl += `&_t=${Date.now()}`; diff --git a/src/inc/routes/ajax.mjs b/src/inc/routes/ajax.mjs index a65f462..c911f37 100644 --- a/src/inc/routes/ajax.mjs +++ b/src/inc/routes/ajax.mjs @@ -203,6 +203,8 @@ export default (router, tpl) => { tag: query.tag || null, hall: query.hall || null, user: query.user || null, + userHall: query.userHall || null, + userHallOwner: query.userHallOwner || null, mime: query.mime || (req.cookies.mime || null), mode: query.mode !== undefined ? +query.mode : req.mode, ratings: ratingsArr,