Files
microdao-daarion/services/matrix-presence-aggregator/app/models.py
Apple 5bed515852 feat: Upgrade Global Presence to SSE architecture
- matrix-presence-aggregator v2 with SSE endpoint
- Created @presence_daemon Matrix user
- SSE proxy in Next.js /api/presence/stream
- Updated frontend to use SSE instead of WebSocket
- Real-time city online count and room presence
2025-11-26 14:43:46 -08:00

25 lines
528 B
Python

"""Data models for Presence Aggregator"""
from pydantic import BaseModel
from typing import List
from datetime import datetime
class RoomPresence(BaseModel):
room_id: str # internal room id from DB
matrix_room_id: str # Matrix room ID (!xxx:domain)
online: int
typing: int
class CityPresence(BaseModel):
online_total: int
rooms_online: int
class PresenceSnapshot(BaseModel):
type: str = "presence_update"
timestamp: datetime
city: CityPresence
rooms: List[RoomPresence]