feat: Implement server-side comment preloading for improved performance and introduce new comment features including pinned comments, locked threads, and custom emojis.

This commit is contained in:
x
2026-01-25 15:12:57 +01:00
parent 68011c60de
commit bf5996d2ba
6 changed files with 108 additions and 15 deletions

View File

@@ -105,6 +105,16 @@ export default (router, tpl) => {
if (mode === 'item') {
data.hidePagination = true;
if (req.session) {
data.comments = await f0cklib.getComments(req.params.itemid);
const sub = await f0cklib.getSubscriptionStatus(req.session.id, req.params.itemid);
data.isSubscribed = sub;
data.commentsJSON = Buffer.from(JSON.stringify(data.comments || [])).toString('base64');
} else {
data.comments = [];
data.isSubscribed = false;
data.commentsJSON = Buffer.from('[]').toString('base64');
}
}
return res.reply({ body: tpl.render(mode, data, req) });