Update files
This commit is contained in:
parent
bab6b49585
commit
3e89c8d42e
|
|
@ -36,18 +36,15 @@ def broadcast_online():
|
||||||
sio.emit('online', online_list, namespace='/mod-chat')
|
sio.emit('online', online_list, namespace='/mod-chat')
|
||||||
|
|
||||||
|
|
||||||
# Create namespace for moderation chat
|
# Namespace handlers for /mod-chat
|
||||||
mod_chat = sio.namespace('/mod-chat')
|
@sio.on('connect', namespace='/mod-chat')
|
||||||
|
|
||||||
|
|
||||||
@mod_chat.on('connect')
|
|
||||||
async def on_connect(sid, environ):
|
async def on_connect(sid, environ):
|
||||||
"""Handle client connection to /mod-chat namespace"""
|
"""Handle client connection to /mod-chat namespace"""
|
||||||
logger.info(f"[WebSocket] Client connected to /mod-chat: {sid}")
|
logger.info(f"[WebSocket] Client connected to /mod-chat: {sid}")
|
||||||
# Don't authorize immediately - wait for 'auth' event
|
# Don't authorize immediately - wait for 'auth' event
|
||||||
|
|
||||||
|
|
||||||
@mod_chat.on('disconnect')
|
@sio.on('disconnect', namespace='/mod-chat')
|
||||||
async def on_disconnect(sid):
|
async def on_disconnect(sid):
|
||||||
"""Handle client disconnection"""
|
"""Handle client disconnection"""
|
||||||
logger.info(f"[WebSocket] Client disconnected from /mod-chat: {sid}")
|
logger.info(f"[WebSocket] Client disconnected from /mod-chat: {sid}")
|
||||||
|
|
@ -57,7 +54,7 @@ async def on_disconnect(sid):
|
||||||
broadcast_online()
|
broadcast_online()
|
||||||
|
|
||||||
|
|
||||||
@mod_chat.on('auth')
|
@sio.on('auth', namespace='/mod-chat')
|
||||||
async def on_auth(sid, data):
|
async def on_auth(sid, data):
|
||||||
"""Handle authentication for moderation chat"""
|
"""Handle authentication for moderation chat"""
|
||||||
try:
|
try:
|
||||||
|
|
@ -105,7 +102,7 @@ async def on_auth(sid, data):
|
||||||
await sio.disconnect(sid, namespace='/mod-chat')
|
await sio.disconnect(sid, namespace='/mod-chat')
|
||||||
|
|
||||||
|
|
||||||
@mod_chat.on('message')
|
@sio.on('message', namespace='/mod-chat')
|
||||||
async def on_message(sid, data):
|
async def on_message(sid, data):
|
||||||
"""Handle moderation chat message"""
|
"""Handle moderation chat message"""
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue