How often the site should refresh for new messages , in seconds. minimum 3 seconds.
22 | 23 | -------------------------------------------------------------------------------- /svelte.config.js: -------------------------------------------------------------------------------- 1 | import adapter from '@sveltejs/adapter-auto'; 2 | import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; 3 | 4 | /** @type {import('@sveltejs/kit').Config} */ 5 | const config = { 6 | // Consult https://kit.svelte.dev/docs/integrations#preprocessors 7 | // for more information about preprocessors 8 | preprocess: vitePreprocess(), 9 | 10 | kit: { 11 | // adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list. 12 | // If your environment is not supported or you settled on a specific environment, switch out the adapter. 13 | // See https://kit.svelte.dev/docs/adapters for more information about adapters. 14 | adapter: adapter() 15 | } 16 | }; 17 | 18 | export default config; 19 | -------------------------------------------------------------------------------- /src/routes/api/stats/+server.ts: -------------------------------------------------------------------------------- 1 | import { json } from '@sveltejs/kit'; 2 | import Listener from '../../../models/listener.schema'; 3 | 4 | export async function GET({ url }) { 5 | const lim = parseInt(url.searchParams.get('lim') ?? '100'); 6 | 7 | const activeUsers = await Listener.find( 8 | { $expr: { $gt: [{ $size: '$messages' }, 4] } } 9 | // { 10 | // messages: { $slice: -lim } 11 | // } 12 | ); 13 | 14 | const totalmessages = activeUsers.reduce((acc, user) => acc + user.messages.length, 0); 15 | const identities = await Listener.distinct('rid'); 16 | 17 | return json({ 18 | status: 200, 19 | body: { 20 | activeUsers: activeUsers.length, 21 | totalMessages: totalmessages, 22 | identities: identities.length 23 | } 24 | }); 25 | } 26 | -------------------------------------------------------------------------------- /src/lib/components/ui/textarea/textarea.svelte: -------------------------------------------------------------------------------- 1 | 12 | 13 | 23 | -------------------------------------------------------------------------------- /src/routes/li/[room]/Message/ImageThumbnail.svelte: -------------------------------------------------------------------------------- 1 | 17 | 18 |Profanity filter off
Profanity filter on