feat: Add presence heartbeat for Matrix online status
- 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
This commit is contained in:
18
backend/middleware/context.middleware.ts
Normal file
18
backend/middleware/context.middleware.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* 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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user