- matrix-gateway: POST /internal/matrix/presence/online endpoint - usePresenceHeartbeat hook with activity tracking - Auto away after 5 min inactivity - Offline on page close/visibility change - Integrated in MatrixChatRoom component
19 lines
381 B
TypeScript
19 lines
381 B
TypeScript
/**
|
|
* Context Middleware
|
|
* Extracts X-DAO-ID header and attaches to request context
|
|
*/
|
|
|
|
import type { Request, Response, NextFunction } from 'express';
|
|
|
|
export function contextMiddleware(req: Request, res: Response, next: NextFunction): void {
|
|
const daoId = req.headers['x-dao-id'] as string | undefined;
|
|
|
|
if (daoId) {
|
|
(req as any).daoId = daoId;
|
|
}
|
|
|
|
next();
|
|
}
|
|
|
|
|