WIP Chat overhaul

This commit is contained in:
2026-07-26 21:31:28 +02:00
parent e61e24dfe8
commit f803ec27a5
10 changed files with 1266 additions and 345 deletions

View File

@@ -4,6 +4,7 @@
"meme": "Meme",
"halls": "Hallen",
"tags": "Tags",
"chat": "Chat",
"search": "Suchen",
"random": "Zufall",
"profile": "Profil",

View File

@@ -4,6 +4,7 @@
"meme": "Meme",
"halls": "Halls",
"tags": "Tags",
"chat": "Chat",
"search": "Search",
"random": "Random",
"profile": "Profile",

View File

@@ -4,6 +4,7 @@
"meme": "meme",
"halls": "Hallen",
"tags": "Tags",
"chat": "Chat",
"search": "Zoeken",
"random": "Willekeurig",
"profile": "profiel",

View File

@@ -4,6 +4,7 @@
"meme": "Memen",
"halls": "Hallen",
"tags": "Etiketten",
"chat": "Geschwafel",
"search": "Suche",
"random": "Zufall",
"profile": "Profil",

View File

@@ -47,6 +47,25 @@ function buildBgHostRegex() {
export default (router, tpl) => {
// GET /chat — Dedicated site chat page
router.get('/chat', async (req, res) => {
if (!cfg.websrv.enable_global_chat) {
return res.reply({ code: 404, body: 'Not found' });
}
if (!req.session) {
return res.redirect('/login');
}
if (req.session.banned) {
return res.reply({ code: 403, body: 'Access denied: You are banned' });
}
return res.html(tpl.render('chat', {
session: req.session,
hidePagination: true,
link: { main: '/chat', path: '/chat' },
domain: cfg.main.url.domain
}, req));
});
// GET /api/chat — fetch recent messages
router.get('/api/chat', async (req, res) => {
if (!cfg.websrv.enable_global_chat) {