Describe connections method was fixed
This commit is contained in:
@@ -57,8 +57,10 @@ class Routes():
|
||||
await broadcast(websocket, self.__get_event(name, "deleted", entity_id ))
|
||||
|
||||
async def _describe(self, websocket, event):
|
||||
connections = list(self.__connections)
|
||||
data = { c.user["id"]: connections.count(c) for c in connections }
|
||||
data = {}
|
||||
for connection in self.__connections:
|
||||
user_id = connection.user["id"]
|
||||
data[user_id] = data[user_id] + 1 if user_id in data else 1
|
||||
await websocket.send(json.dumps(self.__get_event("connections", "described", data)))
|
||||
|
||||
async def _broadcast(self, _, event):
|
||||
|
||||
Reference in New Issue
Block a user