WIP Chat overhaul
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
"meme": "Meme",
|
||||
"halls": "Hallen",
|
||||
"tags": "Tags",
|
||||
"chat": "Chat",
|
||||
"search": "Suchen",
|
||||
"random": "Zufall",
|
||||
"profile": "Profil",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"meme": "Meme",
|
||||
"halls": "Halls",
|
||||
"tags": "Tags",
|
||||
"chat": "Chat",
|
||||
"search": "Search",
|
||||
"random": "Random",
|
||||
"profile": "Profile",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"meme": "meme",
|
||||
"halls": "Hallen",
|
||||
"tags": "Tags",
|
||||
"chat": "Chat",
|
||||
"search": "Zoeken",
|
||||
"random": "Willekeurig",
|
||||
"profile": "profiel",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"meme": "Memen",
|
||||
"halls": "Hallen",
|
||||
"tags": "Etiketten",
|
||||
"chat": "Geschwafel",
|
||||
"search": "Suche",
|
||||
"random": "Zufall",
|
||||
"profile": "Profil",
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user