Skip to content

Commit 7cc2420

Browse files
committed
remove multi-user with same data...
1 parent 5c95c86 commit 7cc2420

1 file changed

Lines changed: 13 additions & 24 deletions

File tree

rpc_client.py

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -587,39 +587,28 @@ async def handle_socket(self, uri):
587587
for i in bot_id:
588588
self.bots_socket[uri].add(i)
589589

590-
users_ws = data.pop("users", None)
590+
user_ws = data.pop("user", None)
591591

592-
if not users_ws:
592+
if not user_ws:
593593
continue
594594

595-
else:
596-
users_ws = [u for u in users_ws if u in user_clients]
595+
self.users_socket[uri].add(user_ws)
597596

598597
try:
599-
if not data["info"].get("members"):
600-
data["info"]["members"] = len(users_ws)
598+
user = user_clients[user_ws]["user"]
601599
except KeyError:
602-
pass
603-
604-
for u_id in users_ws:
605-
606-
self.users_socket[uri].add(u_id)
607-
608-
try:
609-
user = user_clients[u_id]["user"]
610-
except KeyError:
611-
continue
600+
continue
612601

613-
self.gui.update_log(f"op: {data['op']} | {user} {u_id} | "
614-
f"bot: {(bot_name + ' ') if bot_name else ''}[{bot_id}]",
615-
log_type="info")
602+
self.gui.update_log(f"op: {data['op']} | {user} {user_ws} | "
603+
f"bot: {(bot_name + ' ') if bot_name else ''}[{bot_id}]",
604+
log_type="info")
616605

617-
try:
618-
self.last_data[u_id][bot_id] = data
619-
except KeyError:
620-
self.last_data[u_id] = {bot_id: data}
606+
try:
607+
self.last_data[user_ws][bot_id] = data
608+
except KeyError:
609+
self.last_data[user_ws] = {bot_id: data}
621610

622-
self.process_data(u_id, bot_id, data)
611+
self.process_data(user_ws, bot_id, data)
623612

624613
elif msg.type in (aiohttp.WSMsgType.CLOSED,
625614
aiohttp.WSMsgType.CLOSING,

0 commit comments

Comments
 (0)