From 50c12f4b5c94b61791280cb2e39aef20d32ff7f5 Mon Sep 17 00:00:00 2001 From: SantaSpeen Date: Thu, 17 Aug 2023 18:26:53 +0300 Subject: [PATCH] FIX _identifiers and e | e --- src/core/Client.py | 4 +++- src/core/tcp_server.py | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/Client.py b/src/core/Client.py index c6390b3..308cf81 100644 --- a/src/core/Client.py +++ b/src/core/Client.py @@ -634,7 +634,9 @@ async def _chat_handler(self, data): self.log.info(f"{message}" if to_all else f"{self.nick}: {msg}") await self._send(f"C:{message}", to_all=to_all, to_self=to_self, writer=writer) need_send = False - except KeyError | AttributeError: + except KeyError: + self.log.error(i18n.client_event_invalid_data.format(ev_data)) + except AttributeError: self.log.error(i18n.client_event_invalid_data.format(ev_data)) if need_send: if config.Options['log_chat']: diff --git a/src/core/tcp_server.py b/src/core/tcp_server.py index 0dfaf4f..8038f8a 100644 --- a/src/core/tcp_server.py +++ b/src/core/tcp_server.py @@ -53,6 +53,8 @@ async def auth_client(self, reader, writer): client.roles = res["roles"] client._guest = res["guest"] client._identifiers = {k: v for s in res["identifiers"] for k, v in [s.split(':')]} + if not client._identifiers.get("ip"): + client._identifiers["ip"] = client._addr[0] # noinspection PyProtectedMember client._update_logger() except Exception as e: