irc: Handle user disconnection
patch fd56f8eea3d9bba22d6597d934449795fb156101
Author: E. Bosch <presidev@AT@gmail.com>
Date: Fri Jan 29 01:24:25 CET 2021
* irc: Handle user disconnection
hunk ./irc.py 53
- message = await user.stream.read_until(b'\n')
+ try:
+ message = await user.stream.read_until(b'\n')
+ except tornado.iostream.StreamClosedError:
+ if user in self.users.values():
+ del self.users[user.irc_nick]
+ del user
+ break
hunk ./irc.py 250
- self.registered = True
+ self.registered = False