FIX _identifiers and e | e

This commit is contained in:
Maxim Khomutov 2023-08-17 18:26:53 +03:00
parent f145048cc1
commit 50c12f4b5c
2 changed files with 5 additions and 1 deletions

View File

@ -634,7 +634,9 @@ class Client:
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']:

View File

@ -53,6 +53,8 @@ class TCPServer:
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: