Skip to content

Commit

Permalink
FIX _identifiers and e | e
Browse files Browse the repository at this point in the history
  • Loading branch information
SantaSpeen committed Aug 17, 2023
1 parent f145048 commit 50c12f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/Client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']:
Expand Down
2 changes: 2 additions & 0 deletions src/core/tcp_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 50c12f4

Please sign in to comment.